infra: adding step to publish action
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.
@@ -14,10 +14,24 @@ jobs:
python-version: '3.7'
- name: Build wheels
run: ./scripts/build.sh
+ - name: Install twine
+ run: |
+ pip install twine
+ # The step below publishes to testpypi in order to catch any issues
+ # with the package configuration that would cause a failure to upload
+ # to pypi. One example of such a failure is if a classifier is
+ # rejected by pypi (e.g "3 - Beta"). This would cause a failure during the
+ # middle of the package upload causing the action to fail, and certain packages
+ # might have already been updated, this would be bad.
+ - name: Publish to TestPyPI
+ env:
+ TWINE_USERNAME: ${{ secrets.test_pypi_username }}
+ TWINE_PASSWORD: ${{ secrets.test_pypi_password }}
+ run: |
+ twine upload --repository testpypi --skip-existing --verbose dist/*
- name: Publish to PyPI
env:
TWINE_USERNAME: '__token__'
TWINE_PASSWORD: ${{ secrets.pypi_password }}
run: |
- pip install twine
twine upload --skip-existing --verbose dist/*
