From 37923747b5163a003429042d664528d2467d2acd Mon Sep 17 00:00:00 2001 From: RishabhJain2018 Date: Sun, 14 Jun 2026 14:54:29 -0700 Subject: [PATCH] Use TestPyPI API token auth instead of username/password. Authenticate TestPyPI uploads with __token__ and TEST_PYPI_API_TOKEN, matching the production PyPI publish flow. --- .github/CI_CD.md | 3 +-- .github/workflows/ci-cd.yml | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/CI_CD.md b/.github/CI_CD.md index 9901aa2b..708fcbe0 100644 --- a/.github/CI_CD.md +++ b/.github/CI_CD.md @@ -16,8 +16,7 @@ Configure these under **Settings → Secrets and variables → Actions**: | Secret | Used for | |--------|----------| | `CODECOV_TOKEN` | Codecov upload | -| `TEST_PYPI_USERNAME` | TestPyPI publish on `staging` pushes | -| `TEST_PYPI_PASSWORD` | TestPyPI publish on `staging` pushes | +| `TEST_PYPI_API_TOKEN` | TestPyPI publish on `staging` pushes | | `PYPI_API_TOKEN` | Production PyPI publish on tag pushes | ## GitHub environments diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 801788c5..06addb0c 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -137,8 +137,8 @@ jobs: - name: Build and publish package to TestPyPI env: - TWINE_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }} run: | python -m pip install --upgrade pip setuptools wheel twine python setup.py sdist bdist_wheel