Skip to content

fix(ci): split release.yml into version + publish jobs#1836

Merged
felixweinberger merged 1 commit intomainfrom
fweinberger/fix-release-publish
Apr 1, 2026
Merged

fix(ci): split release.yml into version + publish jobs#1836
felixweinberger merged 1 commit intomainfrom
fweinberger/fix-release-publish

Conversation

@felixweinberger
Copy link
Copy Markdown
Contributor

Fixes the failed alpha.1 publish (run 23850387096). Two root causes, one architectural change.

Motivation and Context

Bug 1 — publish: input not shell-evaluated. changesets/action passes the publish: string as argv. pnpm run build:all && pnpm changeset publish became pnpm run build:all with extra args &&, pnpm, changeset, publish — which pnpm forwarded to tsdown as entry points:

Cannot resolve entry module &&.
Cannot resolve entry module pnpm.

Never fired before because every previous run was in PR mode. Wrapped in package.json's ci:publish script — single command, no shell operators.

Bug 2 — NPM_TOKEN environment-scoped, job had no environment. The secret lives in the release environment (was used by main.yml's now-deleted publish job). release.yml had no environment: so the secret resolved empty.

Split into two jobs:

  • version (ungated): runs changesets/action with no publish: input. Only creates/updates the Version PR. Outputs hasChangesets.
  • publish (gated): needs: version, if: hasChangesets == 'false', environment: release. Runs changesets/action with publish: pnpm run ci:publish. Approval prompt fires only when actually publishing.

Feature PRs land → Version PR updates automatically. Merge Version PR → publish job waits for approval → token visible → publishes.

Also enables provenance (id-token: write + NPM_CONFIG_PROVENANCE: 'true').

How Has This Been Tested?

The build path was verified locally on changeset-release/main (pnpm install && pnpm build:all clean). The workflow structure follows the documented changesets/action hasChangesets output pattern.

After this merges: version job runs → hasChangesets: false (versions still bumped from #1420, no new changesets) → publish job → approval prompt → publishes alpha.1.

Breaking Changes

None.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

The release environment's required reviewers (if configured at Settings → Environments → release) become the publish approvers.

Fixes the failed alpha.1 publish (run 23850387096). Two issues:

1. changesets/action passed 'publish: pnpm run build:all && pnpm
   changeset publish' as argv, not through a shell — '&&' became a
   literal arg forwarded to tsdown. Wrapped in package.json ci:publish
   script.

2. NPM_TOKEN is environment-scoped to 'release' but the job had no
   environment. Now the publish job has environment: release.

Split into two jobs so the Version PR auto-updates (ungated) but
publish requires environment approval. The version job's hasChangesets
output gates the publish job.

Also enables provenance (id-token: write + NPM_CONFIG_PROVENANCE).
@felixweinberger felixweinberger requested a review from a team as a code owner April 1, 2026 13:22
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 1, 2026

⚠️ No Changeset found

Latest commit: 61dfbf3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 1, 2026

Open in StackBlitz

@modelcontextprotocol/client

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/client@1836

@modelcontextprotocol/server

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/server@1836

@modelcontextprotocol/express

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/express@1836

@modelcontextprotocol/fastify

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/fastify@1836

@modelcontextprotocol/hono

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/hono@1836

@modelcontextprotocol/node

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/node@1836

commit: 61dfbf3

@felixweinberger felixweinberger merged commit 53fb84b into main Apr 1, 2026
23 checks passed
@felixweinberger felixweinberger deleted the fweinberger/fix-release-publish branch April 1, 2026 13:36
@claude claude bot mentioned this pull request Apr 1, 2026
9 tasks
felixweinberger added a commit that referenced this pull request Apr 1, 2026
Drops NPM_TOKEN/NODE_AUTH_TOKEN from the publish job. npm CLI
auto-detects GitHub Actions OIDC (id-token: write was already present
from #1836) and exchanges for a short-lived publish credential.

Also drops registry-url from setup-node — it writes a .npmrc expecting
NODE_AUTH_TOKEN, which short-circuits before OIDC kicks in. npm
defaults to npmjs.org without it.

Requires trusted publishers configured per-package on npmjs.com:
client/server/express/hono/node/fastify → workflow release.yml,
environment release.
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