ci: publish to PyPI via trusted publishing instead of an API token - #96
Conversation
Argus reviewAuto-review is off for this repo. Tick the box below to run a review on this PR.
Estimated cost
Tip: you can also comment |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Knowledge base: Disabled due to WalkthroughThe pre-release and publish workflows now use GitHub OIDC trusted publishing for PyPI. Both ChangesPyPI OIDC publishing
Estimated code review effort: 1 (Trivial) | ~5 minutes Sequence Diagram(s)sequenceDiagram
participant ReleaseWorkflow
participant GitHubOIDC
participant PyPI
ReleaseWorkflow->>GitHubOIDC: Request OIDC token
GitHubOIDC-->>ReleaseWorkflow: Return identity token
ReleaseWorkflow->>PyPI: Publish package with OIDC identity
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Matches qBraid/qBraid#1346, which does the same for the SDK.
The publish workflows authenticated to PyPI with
PYPI_API_TOKEN, a long-livedcredential stored as a repository secret. This switches them to Trusted Publishing:
the job requests
id-token: write, andpypa/gh-action-pypi-publishmints ashort-lived OIDC credential scoped to that one workflow. No publishing secret is
stored in the repository afterwards.
Trusted Publishing is also the prerequisite for PEP 740 attestations, which the
action generates by default. Those attach the repository, workflow and commit SHA
to each uploaded file, so a published wheel can be traced back to the commit that
built it. They apply to releases published after this merges, not retroactively.
Requires action before the next release. A trusted publisher must be registered
on the PyPI project settings naming this repository, the workflow filename, and the
environment, or publishing will fail rather than fall back to the token. The
PYPI_API_TOKENsecret can be deleted once a release has gone out successfully.TestPyPI workflows are left on their existing token, since that registry needs its
own separate publisher configuration.
🤖 Generated with Claude Code
Summary by CodeRabbit