Skip to content

Commit 027f61f

Browse files
author
alrex
authored
infra: adding step to publish action (#733)
Adding a step to test that uploading packages to pypi should work. This should prevent issues that occurred in the release of 0.7.0 from happening where a classifier was set incorrectly (3 - Beta), causing pypi to return a 400 and fail publishing packages.
1 parent b51a518 commit 027f61f

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

.github/workflows/publish.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,24 @@ jobs:
1414
python-version: '3.7'
1515
- name: Build wheels
1616
run: ./scripts/build.sh
17+
- name: Install twine
18+
run: |
19+
pip install twine
20+
# The step below publishes to testpypi in order to catch any issues
21+
# with the package configuration that would cause a failure to upload
22+
# to pypi. One example of such a failure is if a classifier is
23+
# rejected by pypi (e.g "3 - Beta"). This would cause a failure during the
24+
# middle of the package upload causing the action to fail, and certain packages
25+
# might have already been updated, this would be bad.
26+
- name: Publish to TestPyPI
27+
env:
28+
TWINE_USERNAME: ${{ secrets.test_pypi_username }}
29+
TWINE_PASSWORD: ${{ secrets.test_pypi_password }}
30+
run: |
31+
twine upload --repository testpypi --skip-existing --verbose dist/*
1732
- name: Publish to PyPI
1833
env:
1934
TWINE_USERNAME: '__token__'
2035
TWINE_PASSWORD: ${{ secrets.pypi_password }}
2136
run: |
22-
pip install twine
2337
twine upload --skip-existing --verbose dist/*

0 commit comments

Comments
 (0)