ci: publish to PyPI via trusted publishing instead of an API token - #411
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 |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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! |
The permissions block landed on build_sdist, which only builds an sdist. The pypi-publish job runs gh-action-pypi-publish and had no permissions at all, so ACTIONS_ID_TOKEN_REQUEST_TOKEN was unset and the OIDC exchange failed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Seems like the publish step did not have the right permissions, I think you accidentally added them in publish sdist step. I've added them in the |
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The -alpha suffix is what lets repeat pre-releases bump to a1, a2 and so on. A plain 1.2.0 works for the first pre-release, then the stamper raises InvalidVersionError because there is no prerelease segment to increment. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Completed pre-release - https://github.com/qBraid/pyqasm/actions/runs/32821887958/job/97722479493 Had to bump to |
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.
Trusted publishing has been configured on PyPI for both
release.ymlandpre-release.yml