Skip to content

Commit 543c44a

Browse files
[FSSDK-12881] tagging improvement
1 parent 3bad946 commit 543c44a

3 files changed

Lines changed: 13 additions & 10 deletions

File tree

.github/workflows/ghr_backfill.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ name: Backfill GitHub Package Registry
77
#
88
# dist-tags: scripts/publish.sh computes the tag for each version from the
99
# version string against GHR's current latest (latest only when strictly newer,
10-
# otherwise v<major>-latest; beta/alpha/rc for pre-releases), so latest never
11-
# moves backwards while backfilling historical versions.
10+
# otherwise v<major>-last-published; beta/alpha/rc for pre-releases), so latest
11+
# never moves backwards while backfilling historical versions.
1212
#
1313
# Idempotent: scripts/publish.sh skips any version already present on GHR, so
1414
# this can be re-run safely.

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
5353
# publish.sh derives name/version from the tarball and computes the
5454
# dist-tag itself: `latest` only when strictly newer than the registry's
55-
# current latest, otherwise v<major>-latest; beta/alpha/rc for
55+
# current latest, otherwise v<major>-last-published; beta/alpha/rc for
5656
# pre-releases. npm publishes first; if it fails the job stops before GHR,
5757
# keeping the registries in sync.
5858
- id: release

scripts/publish.sh

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,14 @@
3434
# - Computes the dist-tag from the version:
3535
# * pre-releases (beta/alpha/rc) get their own tag, never `latest`.
3636
# * a stable release gets `latest` ONLY when it is strictly greater (by
37-
# semver) than the registry's current `latest`. Otherwise it is tagged
38-
# `v<major>-latest` (the JS SDK's long-standing per-major release line,
39-
# which consumers install via @<pkg>@v<major>-latest), so `latest` never
40-
# moves backwards onto an older release — e.g. 5.x shipped after 6.x, or
41-
# a 6.4.1 patch shipped while latest is 6.5.0.
37+
# semver) than the registry's current `latest`, so `latest` never moves
38+
# backwards onto an older release — e.g. 5.x shipped after 6.x, or a
39+
# 6.4.1 patch shipped while latest is 6.5.0. Otherwise it is tagged
40+
# `v<major>-last-published`: a per-major pointer to the most recently
41+
# published version on that major line. It is named for recency (not
42+
# "latest") on purpose — an out-of-order backport can leave it below the
43+
# highest version in the major. Consumers install a line via
44+
# @<pkg>@v<major>-last-published.
4245
set -euo pipefail
4346

4447
dry_run="${DRY_RUN:-false}"
@@ -120,8 +123,8 @@ case "$version" in
120123
tag=latest
121124
else
122125
major=${version%%.*}
123-
tag="v${major}-latest"
124-
echo "Current latest is ${current_latest}; ${version} is not newer, tagging as ${tag} to preserve latest."
126+
tag="v${major}-last-published"
127+
echo "Current latest is ${current_latest}; ${version} is not newer, tagging as ${tag} (latest preserved)."
125128
fi
126129
;;
127130
esac

0 commit comments

Comments
 (0)