CI: Simplify test PyPI release

Allow releasing to Test PyPI by setting GitHub
environment "release" variable `PYPI_REPOSITORY_URL`
to `https://test.pypi.org/legacy/`.

Also ensure twine-upload doesn't try to prompt
for credentials, and turn off upload progress bar.
This commit is contained in:
Mike Edmunds
2023-05-07 11:23:15 -07:00
parent 744d467f70
commit a3ad0254cf

View File

@@ -59,8 +59,11 @@ jobs:
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
# For test PyPI, set release var PYPI_REPOSITORY_URL=https://test.pypi.org/legacy/.
# For production PyPI, leave unset (or set to empty string).
TWINE_REPOSITORY_URL: ${{ vars.PYPI_REPOSITORY_URL }}
run: |
python -m twine upload dist/*
python -m twine upload --disable-progress-bar --non-interactive dist/*
- name: Release to GitHub
env: