Skip to content

Commit d80d4e6

Browse files
committed
fix(ci): advance @next dist-tag on stable publish
Regression: after a stable release, npm publish --tag latest correctly advances latest, but @next stays pinned to whichever pre-release we cut last. Consumers tracking `aiwg@next` resolve to stale code (e.g. after 2026.5.3 GA, @next still pointed at 2026.5.3-rc.1). Add a post-publish step that runs `npm dist-tag add aiwg@$VERSION next` when the release is stable. Step is gated on `steps.version.outputs.prerelease == 'false'` so pre-releases (which legitimately update @next via --tag next) are unaffected. Reuses the workflow's OIDC token — no long-lived auth. Verified locally: before: latest=2026.5.3 next=2026.5.3-rc.1 after: latest=2026.5.3 next=2026.5.3 (target state) Force-retag v2026.5.3 to run the workflow with the new step. The publish step's idempotency (already-published path) handles the re-fire cleanly; only the new dist-tag step actually performs work on this run. Refs: #1278 (post-Track A regression)
1 parent 41e563b commit d80d4e6

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

.github/workflows/npm-publish.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,31 @@ jobs:
349349
fi
350350
done
351351
352+
- name: Advance @next dist-tag on stable releases
353+
# On a stable publish (--tag latest), @next is still pointing at
354+
# whatever pre-release we cut last. Consumers tracking `aiwg@next`
355+
# would resolve to stale code. After a stable lands, advance @next
356+
# to point at the same stable version so the channel never lags.
357+
#
358+
# Idempotent — `npm dist-tag add` is a no-op if @next already
359+
# points at the target. Uses the same OIDC-issued auth as the
360+
# publish step above (npm 11.5+ honors the workflow's id-token
361+
# claim for dist-tag operations).
362+
if: steps.version.outputs.prerelease == 'false'
363+
run: |
364+
set -o pipefail
365+
VERSION='${{ steps.version.outputs.version }}'
366+
echo "Advancing aiwg@next → ${VERSION}"
367+
npm dist-tag add "aiwg@${VERSION}" next
368+
# Verify
369+
CURRENT_NEXT=$(npm view "aiwg@next" version 2>/dev/null || echo "")
370+
if [ "$CURRENT_NEXT" = "$VERSION" ]; then
371+
echo "✓ aiwg@next = ${VERSION}"
372+
else
373+
echo "✗ aiwg@next = ${CURRENT_NEXT:-<missing>}, expected ${VERSION}"
374+
exit 1
375+
fi
376+
352377
# ============================================================
353378
# Tarball Sigstore signing — #1287 / A8 (Wave 5 of #1278)
354379
# ============================================================

0 commit comments

Comments
 (0)