Skip to content

Commit 33acdc9

Browse files
committed
Publish to PyPI on tag or release
1 parent 88be1a0 commit 33acdc9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/python-package.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ on:
1010
- v*
1111
pull_request:
1212
branches: [ master ]
13+
release:
14+
types: [ created ]
1315

1416
jobs:
1517
build:
@@ -41,7 +43,7 @@ jobs:
4143
run: |
4244
pytest
4345
- name: Build and publish
44-
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
46+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' && startsWith(github.event.release.tag_name, 'v')
4547
env:
4648
TWINE_USERNAME: __token__
4749
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
@@ -50,4 +52,4 @@ jobs:
5052
pip wheel -w dist --no-deps .
5153
python setup.py sdist
5254
twine upload dist/*
53-
continue-on-error: true
55+
continue-on-error: true

0 commit comments

Comments
 (0)