Repository navigation
Publish to PyPI with trusted publishing - #750
Merged
Merged
Conversation
Use PyPI trusted publishing (OIDC) from the pypi environment instead of the shared PYPI token for the simulation API client upload. 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.
Fixes # (no tracking issue exists yet. A maintainer should create or link one, per
docs/engineering/skills/github-prs.md.)Same-Repository Draft PR Check
PolicyEngine/policyengine-sim-api, not a personal fork.Summary
.github/workflows/publish-clients.yml(policyengine-api-simulation-client) from the shared org-widesecrets.PYPItoken to PyPI trusted publishing (OIDC).publish:environment: pypi. Thepypienvironment already exists in this repo, limited tomain.permissions:block withcontents: readandid-token: write. The job only checks out, generates and builds the client, and uploads.password: ${{ secrets.PYPI }}. The action ignores OIDC while a password is passed.packages-diris kept.secrets.PYPIuse in.github. Nothing else changes: the trigger, theif:gate, and the date-based version0.<YYYYMMDD>.<run_number>.When the first trusted publish happens
workflow_runafter Deploy Simulation API completes successfully for apushevent. Every successful run gets a new version, so no version or changelog bump is needed.workflow_runruns always use the workflow file from the default branch and run withGITHUB_REFset tomain. So this change takes effect only after merge, and thepypienvironment's main-only branch policy is satisfied.simulation-deploy.yml) runs on every push tomainwith no path filters. So merging this PR, like any merge, starts the normal beta → prod deployment. If that deploy succeeds, this workflow publishes the first client release via trusted publishing. If it fails, the first trusted publish happens after the next successful deploy. This PR adds nothing whose purpose is to force a deploy.Before merging
Add a trusted publisher on PyPI for the
policyengine-api-simulation-clientproject (Manage → Publishing):PolicyEnginepolicyengine-sim-apipublish-clients.ymlpypiIf this PR is merged before the publisher is added, the client upload after the next successful deploy fails with
invalid-publisher. Re-runPublish API clientsafter adding the publisher.Testing
actionlint -shellcheck=onpublish-clients.yml: clean before and after.Publish API clientsuploads0.<YYYYMMDD>.<run_number>via trusted publishing.🤖 Generated with Claude Code