Skip to content

Commit 4a01085

Browse files
committed
Test the package name for a dev sign not to publish a dev version
1 parent a3298c3 commit 4a01085

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,15 @@ jobs:
6161
name: python-package-distributions
6262
path: dist/
6363

64+
- name: Test the package name for a dev sign
65+
id: test-package-name
66+
run: |
67+
echo "devs=$(find dist -iname "*.dev*" -exec echo {} +)" | tee -a "${GITHUB_OUTPUT}"
68+
shell: bash
69+
6470
- name: Publish to PyPI
71+
# don't publish if it's a dev release
72+
if: steps.test-package-name.outputs.devs == ''
6573
uses: pypa/gh-action-pypi-publish@release/v1
6674

6775
publish-to-testpypi:
@@ -87,4 +95,5 @@ jobs:
8795
- name: Publish to TestPyPI
8896
uses: pypa/gh-action-pypi-publish@release/v1
8997
with:
98+
skip-existing: true
9099
repository-url: https://test.pypi.org/legacy/

0 commit comments

Comments
 (0)