From a3ad0254cf9be06f92fe3d3f7b5be3f5499dd7b2 Mon Sep 17 00:00:00 2001 From: Mike Edmunds Date: Sun, 7 May 2023 11:23:15 -0700 Subject: [PATCH] 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. --- .github/workflows/release.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index baed104..cf8a467 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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: