From 1a313c21adac7c1be5867b9ff7e4220d1f078167 Mon Sep 17 00:00:00 2001 From: Diego Resendez Date: Sat, 18 Jul 2026 14:59:48 -0500 Subject: [PATCH] ci: publish prereleases under their channel dist-tag, not latest A beta/alpha/rc version must not become 'latest' on npmjs (else npm install serves a prerelease). Derive the dist-tag from the version: 26.7.0-beta.0 -> beta, stable -> latest. Signed-off-by: Diego Resendez --- .github/workflows/release.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fe18667..acd4e8d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,4 +25,10 @@ jobs: - run: npm ci # `npm publish` runs prepublishOnly (lint + complexity + typecheck + test + build) first. # No NODE_AUTH_TOKEN — npm exchanges the OIDC id-token for a short-lived publish token. - - run: npm publish --access public + # A prerelease (26.7.0-beta.N) publishes under its channel tag (beta/alpha/rc) so `latest` + # never points at a beta; a stable version publishes under `latest`. + - name: Publish + run: | + TAG=$(node -e "const v=require('./package.json').version;const m=v.match(/-([a-z]+)/);console.log(m?m[1]:'latest')") + echo "dist-tag: $TAG" + npm publish --access public --tag "$TAG"