From f9c618d68b0ced2b9e38782bdf75377f9643f0a3 Mon Sep 17 00:00:00 2001 From: Chisanan232 Date: Thu, 28 May 2026 08:33:38 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20(ci):=20Pass=20--tag=20alpha?= =?UTF-8?q?=20to=20pnpm=20publish=20for=20pre-release=20versions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .github/workflows/release-node.yml | 21 +++++++++++++++++++-- .github/workflows/release.yml | 11 ++++++++++- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-node.yml b/.github/workflows/release-node.yml index 96b17b8..b981c3c 100644 --- a/.github/workflows/release-node.yml +++ b/.github/workflows/release-node.yml @@ -154,9 +154,17 @@ jobs: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} run: | set -euo pipefail + VERSION=$(node -p "require('./package.json').version") + if [[ "$VERSION" == *-* ]]; then + DIST_TAG="--tag alpha" + else + DIST_TAG="" + fi + echo "Publishing runtime sub-packages at version=$VERSION dist-tag arg='$DIST_TAG'" for pkg in runtime-linux-x64 runtime-linux-arm64 runtime-darwin-x64 runtime-darwin-arm64; do echo "::group::publish @agent-assembly/${pkg}" - pnpm publish --access public --no-git-checks "packages/${pkg}" + # shellcheck disable=SC2086 + pnpm publish --access public --no-git-checks $DIST_TAG "packages/${pkg}" echo "::endgroup::" done @@ -164,4 +172,13 @@ jobs: env: NPM_CONFIG_PROVENANCE: "true" NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: pnpm publish --access public --no-git-checks + run: | + VERSION=$(node -p "require('./package.json').version") + if [[ "$VERSION" == *-* ]]; then + DIST_TAG="--tag alpha" + else + DIST_TAG="" + fi + echo "Publishing main SDK at version=$VERSION dist-tag arg='$DIST_TAG'" + # shellcheck disable=SC2086 + pnpm publish --access public --no-git-checks $DIST_TAG diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 74ea3f0..3386f63 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,6 +35,15 @@ jobs: run: pnpm build - name: Publish package - run: pnpm publish --no-git-checks env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: | + VERSION=$(node -p "require('./package.json').version") + if [[ "$VERSION" == *-* ]]; then + DIST_TAG="--tag alpha" + else + DIST_TAG="" + fi + echo "Publishing version=$VERSION with dist-tag arg='$DIST_TAG'" + # shellcheck disable=SC2086 + pnpm publish --no-git-checks $DIST_TAG From 3d739092a04db281bcff995b358c78f425072f70 Mon Sep 17 00:00:00 2001 From: Chisanan232 Date: Thu, 28 May 2026 09:37:18 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20(ci):=20Derive=20npm?= =?UTF-8?q?=20dist-tag=20from=20SemVer=20pre-release=20identifier?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .github/workflows/release-node.yml | 12 ++++++++---- .github/workflows/release.yml | 6 ++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release-node.yml b/.github/workflows/release-node.yml index b981c3c..28286a6 100644 --- a/.github/workflows/release-node.yml +++ b/.github/workflows/release-node.yml @@ -155,8 +155,10 @@ jobs: run: | set -euo pipefail VERSION=$(node -p "require('./package.json').version") - if [[ "$VERSION" == *-* ]]; then - DIST_TAG="--tag alpha" + # Derive the npm dist-tag from the SemVer pre-release identifier. + # 0.0.1-alpha.1 → --tag alpha, 0.0.1-rc.1 → --tag rc, 0.0.1 → (empty, defaults to @latest) + if [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+-([a-zA-Z]+) ]]; then + DIST_TAG="--tag ${BASH_REMATCH[1]}" else DIST_TAG="" fi @@ -174,8 +176,10 @@ jobs: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} run: | VERSION=$(node -p "require('./package.json').version") - if [[ "$VERSION" == *-* ]]; then - DIST_TAG="--tag alpha" + # Derive the npm dist-tag from the SemVer pre-release identifier. + # 0.0.1-alpha.1 → --tag alpha, 0.0.1-rc.1 → --tag rc, 0.0.1 → (empty, defaults to @latest) + if [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+-([a-zA-Z]+) ]]; then + DIST_TAG="--tag ${BASH_REMATCH[1]}" else DIST_TAG="" fi diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3386f63..264b3a0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,8 +39,10 @@ jobs: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} run: | VERSION=$(node -p "require('./package.json').version") - if [[ "$VERSION" == *-* ]]; then - DIST_TAG="--tag alpha" + # Derive the npm dist-tag from the SemVer pre-release identifier. + # 0.0.1-alpha.1 → --tag alpha, 0.0.1-rc.1 → --tag rc, 0.0.1 → (empty, defaults to @latest) + if [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+-([a-zA-Z]+) ]]; then + DIST_TAG="--tag ${BASH_REMATCH[1]}" else DIST_TAG="" fi