[AAASM-2097] 🐛 (ci): Pass --tag alpha to pnpm publish for pre-release versions#56
Conversation
The v0.0.1-alpha.1 dry-run failed on both release pipelines with: npm error You must specify a tag using --tag when publishing a prerelease version. npm refuses to default a pre-release version (anything with a `-` in the SemVer) to the `latest` dist-tag, because doing so would push unstable bits to default-install users. Compute the dist-tag at publish time from the package version: * version contains '-' (e.g. 0.0.1-alpha.1) → `--tag alpha` * clean SemVer (e.g. 0.0.1) → no dist-tag (`@latest`) Apply to all three publish surfaces: * release.yml line 38 — single-step publish * release-node.yml line 159 (loop) — 4 runtime sub-packages * release-node.yml line 167 — main @agent-assembly/sdk Future `-beta.*` / `-rc.*` work would need its own dist-tag mapping; out of scope here. Tracked: AAASM-2097
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Claude Code review — AAASM-2097CI state25/25 SUCCESS across the full node-sdk CI matrix — napi-build × 4 (ubuntu/macos/windows × Node 20+22), module-smoke (18/20/22), test (18/20/22/24 × ubuntu/macos/windows = 12 entries), quality, coverage-and-analysis, SonarCloud, codecov/patch. The CI runs Scope vs. acceptance criteria
Implementation detail worth recording
VerdictReady for human approval and merge. Full CI green, scope-AC items all verified by inspection or CI, the deferred "live verification" item is the appropriate-by-construction outcome for a publish-time-only change. — Claude Code (Opus 4.7, 1M context) |
The previous implementation hardcoded `--tag alpha` for every
pre-release version. That's wrong as soon as `-beta.*` / `-rc.*` /
`-canary.*` ship — a `0.0.1-rc.1` build would land on the `@alpha`
dist-tag, masking the rc bits behind the alpha channel.
Extract the pre-release identifier from the version string via bash
regex and use it as the dist-tag. No code change needed when a new
pre-release channel is introduced: just bump the version string.
0.0.1 → (empty) → @latest
0.0.1-alpha.1 → --tag alpha → @Alpha
0.0.1-beta.2 → --tag beta → @beta
0.0.1-rc.1 → --tag rc → @rc
0.0.1-canary.20260528 → --tag canary → @canary
Applied to all 3 publish surfaces (release.yml + release-node.yml × 2).
Tracked: AAASM-2097
Claude Code follow-up — derived dist-tag patternUpdate commit: Why this updateThe original commit The fixExtract the pre-release identifier from the version string via bash regex and use it directly as the dist-tag. Zero workflow changes needed when introducing a new pre-release channel: # Derive the npm dist-tag from the SemVer pre-release identifier.
if [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+-([a-zA-Z]+) ]]; then
DIST_TAG="--tag ${BASH_REMATCH[1]}"
else
DIST_TAG=""
fi
Regex sanity-checked locally against 7 version shapes; all pass. ScopeSame 3 publish surfaces as the original commit:
Both files clean against Related follow-upThe user also flagged that — Claude Code (Opus 4.7, 1M context) |
|



Description
The v0.0.1-alpha.1 dry-run failed on both release pipelines with:
npm refuses to default a pre-release version (anything with a
-in the SemVer) to thelatestdist-tag, because doing so would push unstable bits to default-install users.Fix
Compute the dist-tag at publish time from the package version:
0.0.1-alpha.1,0.0.1-rc.1, etc.--tag alpha@alphadist-tag (NOT@latest)0.0.1(clean GA)@latestdist-tagApplied to all three publish surfaces in this repo:
release.ymlrelease-node.ymlrelease-node.yml@agent-assembly/sdkpublishEach publish step now reads
package.jsonversion, branches on*-*, and applies--tag alphaonly for pre-releases.Out-of-scope
Future
-beta.*/-rc.*work would need its own dist-tag mapping (currently everything-...maps toalpha). That's not in this PR's scope — the dry-run is only exercising-alpha.*.Type of Change
Breaking Changes
@latestas before; only pre-release tags get a new dist-tag.Related Issues
Testing
actionlint .github/workflows/release.ymlcleanactionlint .github/workflows/release-node.ymlclean0.0.1-alpha.1and0.0.1(one branches yes, the other no)Verification will fully close after the next release tag push — observe
npm view @agent-assembly/sdk dist-tagsshowing the new dist-tag.Checklist
— Claude Code (Opus 4.7, 1M context)