Skip to content

Commit 8c8cea1

Browse files
committed
Merge branch 'fix/npm-dist-tag-no-latest-on-pre' into 'main'
fix(ci): stop moving @latest dist-tag on RC and beta releases Closes #182 See merge request postgres-ai/postgresai!256
2 parents 7b5e0c6 + 8988a95 commit 8c8cea1

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

.gitlab-ci.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -412,21 +412,22 @@ cli:npm:publish:
412412
exit 1
413413
fi
414414
415-
# Determine npm dist-tags:
415+
# Determine npm dist-tags. Standard npm convention: @latest is reserved
416+
# for the most recent stable (GA) release; pre-releases require explicit
417+
# opt-in via @rc / @beta / @dev so that `npm install postgresai` (no tag)
418+
# never returns an unstable version.
416419
# - X.Y.Z (final release) → @latest
417-
# - X.Y.Z-beta.N → @latest + @beta
418-
# - X.Y.Z-rc.N → @latest + @rc
420+
# - X.Y.Z-beta.N → @beta only
421+
# - X.Y.Z-rc.N → @rc only
419422
# - X.Y.Z-dev.N → @dev only
420423
DIST_TAG=""
421-
EXTRA_TAG=""
424+
EXTRA_TAG="" # No longer used; kept for compat with downstream `[ -n "$EXTRA_TAG" ]` checks under `set -u`.
422425
if printf '%s' "$NPM_VERSION" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+$'; then
423426
DIST_TAG="latest"
424427
elif printf '%s' "$NPM_VERSION" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+-beta\.[0-9]+$'; then
425-
DIST_TAG="latest"
426-
EXTRA_TAG="beta"
428+
DIST_TAG="beta"
427429
elif printf '%s' "$NPM_VERSION" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$'; then
428-
DIST_TAG="latest"
429-
EXTRA_TAG="rc"
430+
DIST_TAG="rc"
430431
elif printf '%s' "$NPM_VERSION" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+-dev\.[0-9]+$'; then
431432
DIST_TAG="dev"
432433
fi

0 commit comments

Comments
 (0)