Repository navigation
ci(preview): publish Python previews to TestPyPI with trusted publishing - #3147
Merged
Merged
Conversation
Drop the long-lived TEST_PYPI_API_TOKEN from the preview publish step and run uv publish with --trusted-publishing always against the same TestPyPI upload and check URLs. The publish job gains id-token: write; it keeps environment: pypi and this file name, which the trusted publisher on each of the six TestPyPI projects is bound to.
@ag-ui/a2a-middleware
@ag-ui/a2ui-middleware
@ag-ui/event-throttle-middleware
@ag-ui/mcp-apps-middleware
@ag-ui/mcp-middleware
@ag-ui/a2a
@ag-ui/adk-js
@ag-ui/adk
@ag-ui/ag2
@ag-ui/agno
@ag-ui/antigravity
@ag-ui/aws-strands
@ag-ui/claude-agent-sdk
@ag-ui/claude-managed-agents
@ag-ui/crewai
@ag-ui/langchain
@ag-ui/langgraph
@ag-ui/llamaindex
@ag-ui/mastra
@ag-ui/pydantic-ai
@ag-ui/vercel-ai-sdk
@ag-ui/watsonx
@ag-ui/a2ui-toolkit
create-ag-ui-app
@ag-ui/client
@ag-ui/core
@ag-ui/encoder
@ag-ui/proto
commit: |
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.
What
Switch the TestPyPI preview publish (
.github/workflows/publish-python-preview.yml) from the long-livedTEST_PYPI_API_TOKENsecret to trusted publishing (GitHub OIDC). This is the follow-up that #3146 left out of scope.Publish all packages to TestPyPIstep no longer setsUV_PUBLISH_TOKEN.uv publish --trusted-publishing always. The--publish-url https://test.pypi.org/legacy/and--check-url https://test.pypi.org/simple/stay the same. Withalways, a missing or mismatched publisher fails the step with TestPyPI's error. The existingPost failure commentstep then reports it on the PR.publishjob getsid-token: write.environment: pypiand the file name do not change. The trusted publishers are bound to both, and a comment now says so.TEST_PYPI_API_TOKENsecret and the TestPyPI token are not deleted. See the rollout order below.build-python-preview.ymlbuilds only six packages, and all six already exist on TestPyPI. So the concern in #3146 about packages with no TestPyPI project yet does not apply to this workflow today. If a package is added to the preview build later, it needs a trusted publisher (or a pending publisher) on TestPyPI first.Trusted publishers on test.pypi.org (already added)
These were added as the TestPyPI owner
CopilotKitand checked by reloading each project's Publishing page. None of the projects had a publisher before, so there were no stale ones.RED: before this change
A probe ran the
Publish all packages to TestPyPIstep exactly as the YAML has it. It used uv 0.12.1 (the version the workflow pins), real TestPyPI, a fake token, a dummyag-ui-tp-probe-do-not-publishdist, and a simulated GitHub Actions OIDC environment. A local fakeACTIONS_ID_TOKEN_REQUEST_URLendpoint recorded requests.The token path uploads with the token and never asks GitHub for an OIDC token.
GREEN: after this change
Same probe, same step, same dist:
uv read the audience (
testpypi) from real test.pypi.org, asked the GitHub OIDC endpoint for an id-token, and sent it to real test.pypi.org to mint an upload token. TestPyPI rejected the fake JWT, so no upload was attempted.https://test.pypi.org/pypi/ag-ui-tp-probe-do-not-publish/jsonreturns 404 after both runs, so nothing was published.Other checks:
actionlint1.7.12 passed on every workflow thatlint-release-workflows.ymlchecks (exit 0).zizmor1.26.1 with.github/zizmor.ymlreports no findings on this file. Onmainit reports one:info[use-trusted-publishing]: prefer trusted publishing for authentication. This change clears it.scripts/release/verify-python-toolchain-pins.shpassed.What this does not prove: a real exchange with a GitHub-issued token. The first preview run after merge proves that.
Rollout order
Publish Python Preview to TestPyPIrun after merge must showuv publishsucceeding with noUV_PUBLISH_TOKENin the step env, and the install-instructions comment on the PR.TEST_PYPI_API_TOKENrepo secret and revoke thetest package creationAPI token on test.pypi.org (scope: all projects, ownerCopilotKit).