Skip to content

Commit cbb011c

Browse files
committed
ci: add pypi publishing
should resolve #9
1 parent 57e4aad commit cbb011c

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/main.yml

+32
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,37 @@ jobs:
6161
path: .coverage.mypy/
6262

6363

64+
pypi:
65+
runs-on: ubuntu-latest
66+
needs: [build] # add all other jobs here
67+
68+
steps:
69+
# ugh https://github.com/actions/toolkit/blob/main/docs/commands.md#path-manipulation
70+
- run: echo "$HOME/.local/bin" >> $GITHUB_PATH
71+
72+
- uses: actions/setup-python@v5
73+
with:
74+
python-version: '3.8'
75+
76+
- uses: actions/checkout@v4
77+
with:
78+
submodules: recursive
79+
80+
- name: 'release to test pypi'
81+
# always deploy merged master to test pypi
82+
if: github.event_name != 'pull_request' && github.event.ref == 'refs/heads/master'
83+
env:
84+
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD_TEST }}
85+
run: pip3 install --user --upgrade build twine && .ci/release --test
86+
87+
- name: 'release to pypi'
88+
# always deploy tags to release pypi
89+
# NOTE: release tags are guarded by on: push: tags on the top
90+
if: github.event_name != 'pull_request' && startsWith(github.event.ref, 'refs/tags')
91+
env:
92+
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
93+
run: pip3 install --user --upgrade build twine && .ci/release
94+
6495
###
6596
build_extension:
6697
env:
@@ -97,3 +128,4 @@ jobs:
97128
with:
98129
name : '${{ env.name }}-firefox-release-latest.zip'
99130
path: 'extension/dist/artifacts/firefox/${{ env.name }}-*.zip'
131+

0 commit comments

Comments
 (0)