From a1376e4a2c9c6645d5aa384a8b9b15f6bd59fe93 Mon Sep 17 00:00:00 2001 From: David Snelling Date: Mon, 24 Aug 2026 10:46:07 -0700 Subject: [PATCH] =?UTF-8?q?ci(publish):=20the=20home=20dist-tag=20follows?= =?UTF-8?q?=20the=20version=20=E2=80=94=20a=20prerelease=20publishes=20und?= =?UTF-8?q?er=20'rc'=20and=20never=20moves=20'latest'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .forgejo/workflows/publish-source.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/publish-source.yml b/.forgejo/workflows/publish-source.yml index 8220bac9..a08875ae 100644 --- a/.forgejo/workflows/publish-source.yml +++ b/.forgejo/workflows/publish-source.yml @@ -34,7 +34,16 @@ jobs: SOURCE_NPM_REG="https://source.soulcraft.com/api/packages/soulcraft/npm/" VERSION="$(node -p "require('./package.json').version")" - echo "Publishing @soulcraft/brainy@${VERSION} to The Source registry..." + # The dist-tag follows the version: a prerelease (any hyphen — + # 10.4.0-rc.1) publishes under 'rc' and must NEVER move 'latest' — + # every consumer resolving 'latest' from this registry would otherwise + # be handed a release candidate. Same rule scripts/release.sh applies + # to the storefront leg. + NPM_TAG="latest" + case "$VERSION" in + *-*) NPM_TAG="rc" ;; + esac + echo "Publishing @soulcraft/brainy@${VERSION} to The Source registry (dist-tag: ${NPM_TAG})..." TMPRC="$(mktemp)" chmod 600 "$TMPRC" @@ -47,7 +56,7 @@ jobs: # this tag's checkout already carries the version being published — # nothing here re-derives it from the tag name. PUBLISH_OK=true - if ! npm publish --tag latest --userconfig "$TMPRC"; then + if ! npm publish --tag "$NPM_TAG" --userconfig "$TMPRC"; then PUBLISH_OK=false fi