Skip to content

Commit 8df6db4

Browse files
committed
publish to TestPyPI or PyPI depending on whether prerelease box is checked
1 parent c3b56c0 commit 8df6db4

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

.github/workflows/python-publish.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ permissions:
99

1010
jobs:
1111
deploy:
12-
1312
runs-on: ubuntu-latest
1413

1514
steps:
@@ -26,9 +25,17 @@ jobs:
2625
- name: Build package
2726
run: python setup.py sdist
2827

29-
- name: Publish package
28+
- name: Publish package to TestPyPI since the "prerelease" checkbox is checked
29+
if: "github.event.release.prerelease"
3030
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
3131
with:
3232
user: __token__
3333
password: ${{ secrets.MATLABENGINE_TEST_PYPI_TOKEN }}
34-
repository_url: https://test.pypi.org/legacy/
34+
repository_url: https://test.pypi.org/legacy/
35+
36+
- name: Publish package to PyPI since the "prerelease" checkbox is unchecked
37+
if: "!github.event.release.prerelease"
38+
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
39+
with:
40+
user: __token__
41+
password: ${{ secrets.MATLABENGINE_PYPI_TOKEN }}

0 commit comments

Comments
 (0)