Skip to content

Commit 16e9727

Browse files
publish-npm: use latest-v<major> tag for older versions
1 parent 5cd0708 commit 16e9727

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

publish-npm/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ runs:
7979
echo "Skipping publish: $name@$version is already in the registry"
8080
else
8181
# Use `latest` only when our version is strictly newer than the registry's
82-
# current latest; otherwise publish the older version under a `latest-<major>`
82+
# current latest; otherwise publish the older version under a `latest-v<major>`
8383
# tag so it stays installable without moving `latest`.
8484
if [[ -z "$latest_version" ]] || semver "$version" -r ">$latest_version" --include-prerelease; then
8585
tag="latest"
8686
else
87-
tag="latest-${version%%.*}"
87+
tag="latest-v${version%%.*}"
8888
echo "::notice ::$version is not newer than registry latest ($latest_version); publishing under '--tag $tag'"
8989
fi
9090

0 commit comments

Comments
 (0)