feat: add per-PR npm beta releases via beta-release label#2366
Open
benminer wants to merge 2 commits into
Open
feat: add per-PR npm beta releases via beta-release label#2366benminer wants to merge 2 commits into
benminer wants to merge 2 commits into
Conversation
benminer
force-pushed
the
feature/npm-beta-release-strategy
branch
from
July 17, 2026 17:29
425b2a8 to
80f44c8
Compare
Lets a PR labeled `beta-release` publish a Changesets snapshot prerelease of its exact code under a pr-<N> npm dist-tag, so it can be end-to-end tested before merging. Promotion is just merging normally through the existing changesets + release.yml flow. Includes a best-effort dist-tag cleanup job on PR close, gated on a not-yet-provisioned NPM_DIST_TAG_TOKEN.
…aces Code review surfaced three real gaps: a missing/empty changeset let the snapshot publish silently no-op while the workflow still posted a false "published" PR comment; the cleanup job never fired if the beta-release label was removed before the PR closed; and changeset version --snapshot throws an opaque error if main is ever in Changesets pre-release mode. Also paginates and null-guards the PR-comment lookup, and hoists the BETA_TAG derivation to avoid it drifting between jobs.
benminer
force-pushed
the
feature/npm-beta-release-strategy
branch
from
July 20, 2026 20:36
80f44c8 to
6215333
Compare
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.
Why
There was no way to publish a testable npm build of a specific PR before merging it, so changes could only be validated after they'd already landed on
mainand shipped tolatest.What Changed
Adds a
beta-release.ymlworkflow: labeling a PRbeta-releasepublishes a Changesets snapshot prerelease of that PR's exact code under apr-<N>npm dist-tag (reusing the existingscripts/publish-adcp-release.tsrelease script viaADCP_NPM_TAG), republishing on every push and commenting install instructions on the PR. Promotion is just merging the PR normally — the reallatestversion is cut fresh by the existing changesets +release.ymlflow. Includes a best-effort dist-tag cleanup job (gated on anNPM_DIST_TAG_TOKENsecret still to be provisioned), guards against no-op publishes when a PR is missing a real changeset, and rejects running during Changesets pre-release mode. Docs added todocs/development/NPM-DIST-TAGS.mddistinguishing this from the existing long-lived beta-channel pattern inv8.0-beta-plan.md.Note
NPM_DIST_TAG_TOKEN(for dist-tag cleanup) and npm trusted-publisher registration forbeta-release.yml(alongside the existingrelease.ymlentry) still need to be provisioned on npmjs.com before this fully works end-to-end.