From cbb011c544c39a8c40ab49ddb19875a1f01f493a Mon Sep 17 00:00:00 2001 From: karlicoss Date: Wed, 24 Apr 2024 23:23:33 +0100 Subject: [PATCH] ci: add pypi publishing should resolve https://github.com/karlicoss/grasp/issues/9 --- .github/workflows/main.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a1e9773..c9c2f24 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -61,6 +61,37 @@ jobs: path: .coverage.mypy/ + pypi: + runs-on: ubuntu-latest + needs: [build] # add all other jobs here + + steps: + # ugh https://github.com/actions/toolkit/blob/main/docs/commands.md#path-manipulation + - run: echo "$HOME/.local/bin" >> $GITHUB_PATH + + - uses: actions/setup-python@v5 + with: + python-version: '3.8' + + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: 'release to test pypi' + # always deploy merged master to test pypi + if: github.event_name != 'pull_request' && github.event.ref == 'refs/heads/master' + env: + TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD_TEST }} + run: pip3 install --user --upgrade build twine && .ci/release --test + + - name: 'release to pypi' + # always deploy tags to release pypi + # NOTE: release tags are guarded by on: push: tags on the top + if: github.event_name != 'pull_request' && startsWith(github.event.ref, 'refs/tags') + env: + TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} + run: pip3 install --user --upgrade build twine && .ci/release + ### build_extension: env: @@ -97,3 +128,4 @@ jobs: with: name : '${{ env.name }}-firefox-release-latest.zip' path: 'extension/dist/artifacts/firefox/${{ env.name }}-*.zip' +