Skip to content

ci: release to npm with changesets and trusted publishing - #500

Merged
feugy merged 3 commits into
mainfrom
ci/changesets-trusted-publishing
Nov 9, 2026
Merged

feugy merged 3 commits into
mainfrom
ci/changesets-trusted-publishing

Conversation

@feugy

@feugy feugy commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

🖖 What's in there?

Releases micro to npm from GitHub Actions with Changesets and npm Trusted Publishing (OIDC), like vercel/flags and vercel/serve. There is no npm token, and every release gets a provenance attestation.

Today nobody at Vercel can publish micro: its only npm owner is a former employee, so 10.0.2 (#497, #498) is tagged but not on npm.

  • .github/workflows/release.yml: on push to main, changesets/action opens a "Version Packages" PR from pending changesets, or publishes when that PR is merged. Manual runs on main retry a failed publish.
  • .changeset/: Changesets config, with public access and the built-in changelog.
  • package.json: adds @changesets/cli, and replaces the stale lerna publish-* scripts with changeset and release.
  • packages/micro/package.json: expands repository. npm requires repository.url to match the GitHub repository exactly when it publishes from GitHub.
  • test/package.json: marks the test workspace as private, so changeset publish skips it.

🤺 How to test?

  1. An npm owner of micro adds a Trusted Publisher on npmjs.com: repository vercel/micro, workflow release.yml. npm requires the first publish within 2 days of that.
  2. Merge this PR. There are no pending changesets, so the workflow publishes micro@10.0.2, the version on main that is not on npm yet.
  3. Check: npm view micro dist-tags shows latest: 10.0.2, published by "GitHub Actions" with provenance.

Next releases: pnpm changeset, commit the file, merge, then merge the "Version Packages" PR.

🔬 Notes to reviewers

  • If step 1 is not done yet, the publish step fails after merge. Run the workflow manually on main once npm is configured.
  • 10.0.2 is published from main, not from tag 10.0.2: the code is the same, and only the repository field differs.
  • I tested locally that a patch changeset bumps only micro (to 10.0.3) and writes its CHANGELOG.md.
  • The 9.x canary line gets the same workflow file name, because npm binds the Trusted Publisher to one file name.

🔗 Related PRs

@socket-security

socket-security Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

@feugy
feugy requested a review from a team November 9, 2026 08:27
@feugy
feugy merged commit 2582b5a into main Nov 9, 2026
5 checks passed
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.

2 participants