Skip to content

Commit 4e8db5c

Browse files
authored
💚 Upload to pypi upon github release
1 parent e516107 commit 4e8db5c

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

.github/workflows/publish-to-test-pypi.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
22

3-
on:
4-
push:
5-
branches:
6-
- main
7-
- v1
3+
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release
4+
on:
5+
release:
6+
types: [published]
87

98
jobs:
109
build-n-publish:
@@ -34,14 +33,12 @@ jobs:
3433
--outdir dist/
3534
3635
- name: Publish distribution 📦 to Test PyPI
37-
if: startsWith(github.ref, 'refs/tags')
3836
uses: pypa/gh-action-pypi-publish@release/v1
3937
with:
4038
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
4139
repository-url: https://test.pypi.org/legacy/
4240

4341
- name: Publish distribution 📦 to PyPI
44-
if: startsWith(github.ref, 'refs/tags')
4542
uses: pypa/gh-action-pypi-publish@release/v1
4643
with:
4744
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)