ci: switch release workflow to staged npm publishing#693
Merged
Conversation
Port kubb-labs/kubb's staged-publish + approval-gated promote flow so a new version isn't installable until a maintainer approves it on npm and on the npm-release-approval GitHub environment. Unlike kubb, packages here version and changelog independently, so promotion creates one GitHub Release per staged package instead of one combined release. Also removes the per-package release/release:canary/release:stage scripts and turbo tasks, which predated staging and referenced a scripts/build.js that no longer exists.
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
|
More templates
@kubb/plugin-axios
@kubb/plugin-cypress
@kubb/plugin-faker
@kubb/plugin-fetch
@kubb/plugin-mcp
@kubb/plugin-msw
@kubb/plugin-react-query
@kubb/plugin-redoc
@kubb/plugin-swr
@kubb/plugin-ts
@kubb/plugin-vue-query
@kubb/plugin-zod
commit: |
Contributor
|
Size Change: 0 B Total Size: 290 kB ℹ️ View Unchanged
|
Port internals/changelog/format.mjs so scripts/createReleases.mjs can stay a verbatim copy of kubb's, gated by the same RELEASE_MODE env var, instead of a separately maintained per-package-only fork. This repo never sets RELEASE_MODE=combined, so the effective behavior (one release per staged package) is unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 Changes
Ports kubb-labs/kubb's staged-publish + approval-gated promote flow to this repo, replacing direct
changeset publish. A new version now sits unreleased on npm until a maintainer runsnpm stage approveand approves thepromotejob's GitHub Environment review, at which point the version is verified live on npm, tagged, and released.The one deliberate difference from kubb: packages here version and changelog independently (
fixed: []/linked: []in.changeset/config.json, unchanged), sopromotecreates one GitHub Release per staged package (tag<name>@<version>, notes from that package's ownCHANGELOG.md), instead of kubb's single combined release for a shared version.scripts/release.mjs(drivespnpm stage publish -r),scripts/verifyRegistry.mjs(confirms staged versions are actually live on npm before promoting), andscripts/createReleases.mjs(creates one GitHub Release per staged package), ported from kubb-labs/kubb and adapted for independent versioning..github/workflows/release.ymlinto areleasejob (build/test, stage-publish viascripts/release.mjs, canary fallback) and a newpromotejob gated by thenpm-release-approvalGitHub Environment (verify → tag → create releases).deploy-platformnow fires only afterpromoteapproves.release/release:canary/release:stagescripts from everypackages/*/package.json, the matchingturbo.jsontasks, the rootrelease:stage(:ci)scripts, and.github/canary.sh— these predated staging andrelease:canaryreferenced ascripts/build.jsthat no longer exists in the repo.CONTRIBUTING.mddocumenting the new flow for maintainers.Prerequisite outside this PR: the
npm-release-approvalGitHub Environment must be created on this repo (Settings → Environments) with the right reviewers, same as it exists on kubb-labs/kubb, before thepromotejob can run.✅ Checklist
pnpm run test.🚀 Release Impact
Generated by Claude Code