Skip to content

Commit 4583d97

Browse files
committed
Mutaully exclude test PyPi and PyPI workflow
1 parent 1253980 commit 4583d97

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

.github/workflows/publish.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ jobs:
3939
if-no-files-found: error
4040
publish-test:
4141
name: Publish to Test PyPI
42+
if: github.event_name == 'push'
43+
needs: [build]
4244
runs-on: ubuntu-latest
43-
needs: build
4445
steps:
4546
- name: Download dist files
4647
uses: actions/download-artifact@v2
@@ -50,14 +51,14 @@ jobs:
5051
- name: Publish package to Test PyPI
5152
uses: pypa/gh-action-pypi-publish@release/v1
5253
with:
54+
repository_url: https://test.pypi.org/legacy/
5355
user: __token__
5456
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
55-
repository_url: https://test.pypi.org/legacy/
5657
publish:
5758
name: Publish to PyPI
59+
if: github.event_name == 'release'
60+
needs: [build]
5861
runs-on: ubuntu-latest
59-
needs: [build, publish-test]
60-
if: github.event_name == 'release' && github.event.action == 'published'
6162
steps:
6263
- name: Download dist files
6364
uses: actions/download-artifact@v2

0 commit comments

Comments
 (0)