feat(release): publish nightly and stable releases through npm trusted publishing
Merged
TH
2mo ago+979+979+012345678901234567890123456789-41-41-01234567890123456789
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 thenightlydist-tag whenmainhas changed, its CI passed, and no nightly shipped that UTC day. The workflow tags the commitnightly/v…, and the npm dist-tag serves as the durable record. - Stable: a repository admin publishes a GitHub release with a new
vX.Y.Ztag targetingmain. Only admins may createv*tags (#3381 documents the ruleset). The tag's run waits up to 20 minutes for that commit's CI, then for approval in thereleaseenvironment. It then:- publishes to
latest - attaches the runner and helper assets to the release
- publishes the MCP Registry entry
- commits
main's next-devversion. That commit is pushed withGITHUB_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.
- publishes to
- Dry run: a PR that touches release tooling builds and verifies every package.
- Token boundary: only
publish(environmentnpm-publish) and the MCP Registry call can mint an id-token.test/ci/release-workflow.test.tspins 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 releasedcommit 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:preparedry run passed at9c6ef86.