ci(publish): the home dist-tag follows the version — a prerelease publishes under 'rc' and never moves 'latest'
This commit is contained in:
parent
dcbad1765a
commit
a1376e4a2c
1 changed files with 11 additions and 2 deletions
|
|
@ -34,7 +34,16 @@ jobs:
|
||||||
|
|
||||||
SOURCE_NPM_REG="https://source.soulcraft.com/api/packages/soulcraft/npm/"
|
SOURCE_NPM_REG="https://source.soulcraft.com/api/packages/soulcraft/npm/"
|
||||||
VERSION="$(node -p "require('./package.json').version")"
|
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)"
|
TMPRC="$(mktemp)"
|
||||||
chmod 600 "$TMPRC"
|
chmod 600 "$TMPRC"
|
||||||
|
|
@ -47,7 +56,7 @@ jobs:
|
||||||
# this tag's checkout already carries the version being published —
|
# this tag's checkout already carries the version being published —
|
||||||
# nothing here re-derives it from the tag name.
|
# nothing here re-derives it from the tag name.
|
||||||
PUBLISH_OK=true
|
PUBLISH_OK=true
|
||||||
if ! npm publish --tag latest --userconfig "$TMPRC"; then
|
if ! npm publish --tag "$NPM_TAG" --userconfig "$TMPRC"; then
|
||||||
PUBLISH_OK=false
|
PUBLISH_OK=false
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue