Repository navigation
🤖 ci: publish to PyPI with trusted publishing - #63
Closed
dancergraham wants to merge 1 commit into
Closed
dancergraham wants to merge 1 commit into
dancergraham wants to merge 1 commit into
Conversation
Replace the API-token upload with pypa/gh-action-pypi-publish in a publish job bound to the pypi environment, so PyPI only accepts OIDC tokens from that environment and its deployment rules gate which tags publish. Split attestation into its own job and drop the unused contents: write permission. Co-Authored-By: Claude Opus 5.5 <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.
Stacked on #62. Merge #62 first and delete its branch on merge so this PR retargets to
main. Otherwise it repeats what happened to #61.Replaces the token-based
releasejob with two jobs:attest(tag orworkflow_dispatch): build-provenance attestation as before. Permissions:id-tokenandattestations: writeonly. Dropscontents: write, which nothing used.publish(tags only, needsattest):environment: pypi,id-token: writeonly,pypa/gh-action-pypi-publishv1.14.3 pinned by SHA,skip-existing: trueas before. The action also uploads PEP 740 attestations to PyPI.Artifacts are downloaded with
pattern: wheels-*andmerge-multiple, so only wheels and the sdist are attested and uploaded.Before tagging a release:
pypienvironment allows only tags matchingv*. Existing tags have no prefix (0.2.3), so tag the next releasev0.x.y, or change the rule to[0-9]*. A non-matching tag fails atpublishwith a deployment-protection error; nothing is uploaded.PYPI_API_TOKENrepo secret and revoke the token on PyPI.Not verifiable before a real tag: the PyPI-side publisher config (owner
dancergraham, repoe57-python, workflowCI.yml, environmentpypi) has to match exactly.Verified locally:
zizmorreports no findings,actionlintis clean, and no workflow referencessecrets.*any more.🤖 Generated with Claude Code