IT-6150: switch PyPI publishing to trusted publishing (OIDC)#375
Draft
jychuah wants to merge 1 commit into
Draft
IT-6150: switch PyPI publishing to trusted publishing (OIDC)#375jychuah wants to merge 1 commit into
jychuah wants to merge 1 commit into
Conversation
Replace token-based twine upload with pypa/gh-action-pypi-publish using GitHub Actions OIDC. Adds id-token: write permission and the pypi environment; removes the PYPI_USERNAME/PYPI_PASSWORD secrets usage. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of IT-6150 — move PyPI release uploads to GitHub Actions OIDC trusted publishing, removing the long-lived
PYPI_USERNAME/PYPI_PASSWORDtoken from repo secrets.What changed (
.github/workflows/publish-on-pypi.yml)permissions: id-token: write(required for OIDC).environment: pypi(must match the Environment field in the PyPI trusted-publisher config).twine uploadstep — which usedsecrets.PYPI_USERNAME/secrets.PYPI_PASSWORD— withpypa/gh-action-pypi-publish(pinned tov1.14.1).twine check --strictas its own step.This workflow only authenticates after a trusted publisher is configured on the PyPI project. Because this PR removes the token auth, merging it before PyPI is configured will break the next release.
Required order:
enthought, this repository, workflow filenamepublish-on-pypi.yml, environmentpypi.Kept as a draft until step 1 is done. /cc @mdickinson