Skip to content

Commit a3ad025

Browse files
committed
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.
1 parent 744d467 commit a3ad025

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,11 @@ jobs:
5959
env:
6060
TWINE_USERNAME: __token__
6161
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
62+
# For test PyPI, set release var PYPI_REPOSITORY_URL=https://test.pypi.org/legacy/.
63+
# For production PyPI, leave unset (or set to empty string).
64+
TWINE_REPOSITORY_URL: ${{ vars.PYPI_REPOSITORY_URL }}
6265
run: |
63-
python -m twine upload dist/*
66+
python -m twine upload --disable-progress-bar --non-interactive dist/*
6467
6568
- name: Release to GitHub
6669
env:

0 commit comments

Comments
 (0)