From 5aec08224b3585b4348cbb2f44cf1b6a0a268c19 Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Thu, 27 Jul 2017 13:49:46 +0200 Subject: [PATCH] Update releases script --- scripts/bump-oss-version.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/bump-oss-version.js b/scripts/bump-oss-version.js index c1e3a38d3b1c77..10137aaad2cd0f 100755 --- a/scripts/bump-oss-version.js +++ b/scripts/bump-oss-version.js @@ -88,8 +88,18 @@ if (exec(`git tag v${version}`).code) { let remote = argv.remote; exec(`git push ${remote} v${version}`); +// Branch that currently has latest tag +let latestBranch = exec(`git branch --contains latest`, {silent: true}).stdout.trim(); + +// Minor version, e.g. `0` if `0.45.0` is released +let versionMinor = +version.match(/\.(\d+)$/)[1]; + +// Do not set `latest` if we are not on the latest branch +// and not releasing a new stable (version "0") +let shouldSkipLatest = latestBranch !== branch && versionMinor !== 0; + // Tag latest if doing stable release -if (version.indexOf(`rc`) === -1) { +if (version.indexOf(`rc`) === -1 && !shouldSkipLatest) { exec(`git tag -d latest`); exec(`git push ${remote} :latest`); exec(`git tag latest`);