fix: publish to PyPI with the token - #61
Merged
Merged
Conversation
Trusted publishing was never configured on the PyPI project, so the 1.0.11 release built cleanly and then failed at the upload with no publisher matching its OIDC claims. The repo already holds a PYPI_TOKEN secret, so use it. The token stays confined to the publish job, which installs nothing and only uploads the artifact the build job produced — the id-token permission is gone since nothing needs it now. A preflight fails fast with a clear message if the secret is ever missing, rather than after a full build. Co-Authored-By: Claude Fable 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.
Why
The 1.0.11 release (#59) built cleanly and failed at the upload:
Trusted publishing was never configured on the PyPI project, so no publisher matched the OIDC claims. The repo already has a
PYPI_TOKENsecret — the same one the old Stainlessbin/publish-pypiused — so use it.Nothing was published and no tag was created:
tagre-checked PyPI, saw 1.0.11 absent, and declined.mainis at 1.0.11 with PyPI still on 0.0.41.What changed
password: ${{ secrets.PYPI_TOKEN }}.id-token: write— nothing needs it now.The token stays confined to the
publishjob, which installs nothing and only uploads the artifactbuildproduced. That separation is the reason a token here is acceptable: no third-party code runs in the same job.After merging
Merging this does not re-trigger the release — it touches a workflow file, not
pyproject.toml. DispatchReleasefrommainto publish 1.0.11;decidere-reads the version, sees it absent from PyPI, and proceeds.Worth doing later: trusted publishing removes the long-lived credential entirely and is what the TypeScript SDK uses. Configuring it on the PyPI project (owner
whopio, repowhopsdk-python, workflowpublish-main.yml, environment blank) would let this revert to OIDC and thePYPI_TOKENsecret be deleted.🤖 Generated with Claude Code
https://claude.ai/code/session_01XV1533iUUxKJxfn4FXptWz