feat(release): publish nightly and stable releases through npm trusted publishing

Merged
TH
2mo ago
+979-41

Summary

.github/workflows/release.yml now owns every npm publish, through npm trusted publishing. No npm token or one-time password is involved.

  • Nightly: the schedule publishes X.Y.Z-nightly.<date>.<run> under the nightly dist-tag when main has changed, its CI passed, and no nightly shipped that UTC day. The workflow tags the commit nightly/v…, and the npm dist-tag serves as the durable record.
  • Stable: a repository admin publishes a GitHub release with a new vX.Y.Z tag targeting main. Only admins may create v* tags (#3381 documents the ruleset). The tag's run waits up to 20 minutes for that commit's CI, then for approval in the release environment. It then:
    • publishes to latest
    • attaches the runner and helper assets to the release
    • publishes the MCP Registry entry
    • commits main's next -dev version. That commit is pushed with GITHUB_TOKEN, so it gets no CI run of its own; it counts as covered by its parent's CI because it only rewrites "version" fields.
  • Dry run: a PR that touches release tooling builds and verifies every package.
  • Token boundary: only publish (environment npm-publish) and the MCP Registry call can mint an id-token. test/ci/release-workflow.test.ts pins that, and pins the exact approval condition.

The layer above (#3388) refuses to publish until GitHub enforces these protections. 12 files.

Validation

At db9484fff6:

  • Plan, version, workflow, and package-script tests: 27/27 pass.
  • Fallow, lint, and format pass.
  • The version-only detection returned true for the real chore: mark 0.21.24 as released commit and false for a code commit.
  • Read-only plans against the live repo: the nightly skips while CI is queued, and the stable plan resolves v0.21.24.
  • Against a stub npm, the publisher published on E404, refused on a network error, and skipped versions already on npm.
  • The macOS release:prepare dry run passed at 9c6ef86.