Allow customisation of release version

Summary: Allows passing the version part to be bumped as part of the release process.

Reviewed By: nikoant

Differential Revision: D21722939

fbshipit-source-id: 94d3ddeb78722dae5dfbc5822f9e70873f565a81
This commit is contained in:
Pascal Hartig
2020-05-27 09:49:48 -07:00
committed by Facebook GitHub Bot
parent 046b8ceac6
commit d6701e2f96

View File

@@ -40,6 +40,8 @@ echo "✨ Making a new release..."
# When starting this job from SandcastleFlipperAutoReleaseCommand, we pass in the revision to release
SANDCASTLE_REVISION="$1"
# Either 'patch', 'minor', or 'major'
VERSION_PART="${2:-minor}"
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SONAR_DIR="$DIR/../"
DESKTOP_DIR="$SONAR_DIR/desktop"
@@ -62,9 +64,8 @@ fi
# if we got called with a rev argument, we got triggered from our automatic sandcastle job
if [ "$SANDCASTLE_REVISION" != "" ];
then
# In future, bump majors instead of minors?
echo "Automatically bumping version to next minor in package.json"
npm -C "$DESKTOP_DIR" version minor
echo "Automatically bumping version to next $VERSION_PART version in package.json"
npm -C "$DESKTOP_DIR" version "$VERSION_PART"
VERSION=$(jq -r '.version' "$DESKTOP_DIR"/package.json)
else
echo "The currently released version is $OLD_VERSION. What should the version of the next release be?"