From 15c2e4bb07592e0937c489bb8efa29b56d035f7b Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Mon, 27 Jan 2020 20:40:27 +0000 Subject: [PATCH] Publish pre-releases as a separate tag on npm npm will install the newest version a package has published to the `latest` tag, including pre-releases, which is not ideal since those may not be ready for production use yet. This uses an alternate tag (`next` is a common convention, but it can be anything) for pre-releases so the default installs only get stable versions. Fixes https://github.com/vector-im/riot-web/issues/12029 --- release.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/release.sh b/release.sh index 7fe462c78..a52fb9eb6 100755 --- a/release.sh +++ b/release.sh @@ -294,9 +294,14 @@ fi rm "${release_text}" rm "${latest_changes}" +npm_publish_flags='' +if [ $prerelease -eq 1 ]; then + # Tag prereleases as `next` so the last stable release remains the default + npm_publish_flags='--tag next' +fi # Login and publish continues to use `npm`, as it seems to have more clearly # defined options and semantics than `yarn` for writing to the registry. -npm publish +npm publish $npm_publish_flags if [ -z "$skip_jsdoc" ]; then echo "generating jsdocs"