From 0172a50a124644d6d4d666d00f6fc5409f6ca971 Mon Sep 17 00:00:00 2001 From: Jamie Holding Date: Wed, 15 Apr 2026 13:07:20 +0000 Subject: [PATCH] ci(release): use --tag next for prereleases Modern npm rejects publishing prerelease versions without an explicit --tag, because tagging an `x.y.z-alpha.N` as `latest` would break `npm install themeparks` for existing users. Parse the version from the git tag and pick the dist-tag accordingly: - Prerelease (contains a "-") -> --tag next - Stable release -> default (latest) Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/release.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 94141fc..29119fc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,7 +22,15 @@ jobs: - run: npm install -g npm@latest # trusted publishing requires npm >= 11.5.1 - run: npm ci - run: npm run lint && npm run typecheck && npm test && npm run build - - run: npm publish --provenance --access public + - name: Publish + run: | + VERSION="${GITHUB_REF_NAME#v}" + if [[ "$VERSION" == *-* ]]; then + # Prerelease (e.g. 7.0.0-alpha.1): do NOT tag as "latest" + npm publish --provenance --access public --tag next + else + npm publish --provenance --access public + fi - uses: softprops/action-gh-release@v2 with: generate_release_notes: true