Repository navigation
ci(npm): publish every npm package through trusted publishing - #9790
Conversation
The four publish workflows authenticate to npm with the runner's OIDC token instead of the long-lived NPM_TOKEN secret, so no npm credential is stored anywhere and every release carries a provenance attestation. - Publish jobs request id-token: write and run Node 24, whose npm 11 is required for trusted publishing. - sim and sim-setup pack once with bun, which rewrites workspace: ranges, smoke-test that tarball, then npm publish the same tarball, so what was tested is what ships. The smoke tests now also assert the bumped version. - sim-setup republishes when its own workflow changes, as sim already does. - simstudio gets the repository field provenance requires. - The setup action drops its registry-url input, which existed only to feed NODE_AUTH_TOKEN.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
[Medium impact] The code appears safe to merge once the four npm trusted publishers are configured as described. SummaryThe four npm workflows now separate building from publishing.
No new actionable issues were found. This review checked the code; it did not run a live publish.
|
There was a problem hiding this comment.
All reported issues were addressed across 6 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
…C token npm trusted publishing accepts OIDC tokens only from GitHub-hosted runners, and the publish jobs ran on Blacksmith by default. Each workflow now builds, tests, packs and smoke-tests on its usual runner with read-only permissions, then hands the tarball to a GitHub-hosted publish job, the only one granted id-token: write. That job runs no repository code, so no test or dependency can mint an npm credential. The TypeScript SDK's GitHub release moves to its own job with contents: write.
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Summary
The four npm publish workflows (
sim,sim-setup,simstudio,simstudio-ts-sdk) authenticate with npm trusted publishing instead of the long-livedNPM_TOKENsecret. The runner's OIDC token is exchanged for a short-lived npm credential at publish time, so no npm credential is stored anywhere, and every release now carries a provenance attestation.id-token: writeand runs Node 24, whose bundled npm 11 is the minimum trusted publishing supports.simandsim-setuppublish the tarball they smoke-tested.npm publishreplacesbun publish, since npm's CLI is what performs the OIDC exchange.bun pm packstill builds the tarball, because it rewritesworkspace:ranges. That one tarball is smoke-tested on Node 20, then published as is, and npm runs no lifecycle scripts for a tarball, so nothing is rebuilt between test and publish. The smoke tests now also check that--versionreports the bumped release version.sim-setuprepublishes when its own workflow changes, assimalready does.simstudiogets arepositoryfield. Provenance requires it to match this repo.registry-urlinput. It existed only to wireNODE_AUTH_TOKENinto an.npmrc.Merge order
Merge only after each package has a trusted publisher configured on npmjs.com (repository
simstudioai/sim, the workflow file below,npm publishallowed). Merged earlier, every publish fails.simstudiopublish-cli.ymlsimpublish-sim-cli.ymlsim-setuppublish-sim-setup.ymlsimstudio-ts-sdkpublish-ts-sdk.ymlOnce all four have published through OIDC, the
NPM_TOKENsecret is removed, and each package is set to disallow token publishing.Testing
simandsim-setuplocally, packed each with a preview version, and ran the workflows' smoke checks against the tarball: version match, the fullsim-setupcommand--helpsweep, and no repository source directories in the tarball.npm publish <tarball> --dry-runresolved the right name, version, tag and access for both.workspace:ranges.actionlintreports nothing new.🤖 Generated with Claude Code