Skip to content

ci(npm): publish every npm package through trusted publishing - #9790

Merged
waleedlatif1 merged 2 commits into
stagingfrom
chore/npm-trusted-publishing
Nov 7, 2026
Merged

waleedlatif1 merged 2 commits into
stagingfrom
chore/npm-trusted-publishing

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

The four npm publish workflows (sim, sim-setup, simstudio, simstudio-ts-sdk) authenticate with npm trusted publishing instead of the long-lived NPM_TOKEN secret. 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.

  • OIDC: each publish job requests id-token: write and runs Node 24, whose bundled npm 11 is the minimum trusted publishing supports.
  • sim and sim-setup publish the tarball they smoke-tested. npm publish replaces bun publish, since npm's CLI is what performs the OIDC exchange. bun pm pack still builds the tarball, because it rewrites workspace: 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 --version reports the bumped release version.
  • sim-setup republishes when its own workflow changes, as sim already does.
  • simstudio gets a repository field. Provenance requires it to match this repo.
  • The setup action drops its registry-url input. It existed only to wire NODE_AUTH_TOKEN into 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 publish allowed). Merged earlier, every publish fails.

Package Workflow
simstudio publish-cli.yml
sim publish-sim-cli.yml
sim-setup publish-sim-setup.yml
simstudio-ts-sdk publish-ts-sdk.yml

Once all four have published through OIDC, the NPM_TOKEN secret is removed, and each package is set to disallow token publishing.

Testing

  • Built sim and sim-setup locally, packed each with a preview version, and ran the workflows' smoke checks against the tarball: version match, the full sim-setup command --help sweep, and no repository source directories in the tarball.
  • npm publish <tarball> --dry-run resolved the right name, version, tag and access for both.
  • The packed manifests contain no workspace: ranges.
  • actionlint reports nothing new.
  • The real proof is the first publish of each package after merge, which I'll watch.

🤖 Generated with Claude Code

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.
@waleedlatif1
waleedlatif1 requested a review from a team as a code owner November 7, 2026 21:53
@vercel

vercel Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Ignored Ignored Preview Nov 7, 2026 10:03pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The code appears safe to merge once the four npm trusted publishers are configured as described.

Summary

The four npm workflows now separate building from publishing.

  • Four npm packages now publish through GitHub's short-lived access.
  • Changes to the sim-setup publishing workflow now trigger its release flow.
  • The simstudio package now names its source repository.

No new actionable issues were found. This review checked the code; it did not run a live publish.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Push to release branch] --> B[Build package]
  B --> C[Pack tarball]
  C --> D[Smoke-test sim and sim-setup]
  C --> E[Upload tarball]
  D --> E
  E --> F[GitHub-hosted publish job]
  F --> G[Publish through npm OIDC]
  G --> H[SDK GitHub release]
Loading

Reviews (3) · Last reviewed commit: "ci(npm): publish from a GitHub-hosted jo..." · Reviewed by Greptile

Comment thread .github/workflows/publish-sim-cli.yml Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 6 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread .github/workflows/publish-sim-cli.yml Resolved
Comment thread .github/workflows/publish-sim-setup.yml Resolved
Comment thread .github/workflows/publish-ts-sdk.yml Resolved
Comment thread .github/workflows/publish-sim-cli.yml Resolved
…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.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 6 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 27972e1 into staging Nov 7, 2026
83 checks passed
@waleedlatif1
waleedlatif1 deleted the chore/npm-trusted-publishing branch November 7, 2026 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant