From 2fd9bac31ca6b63541c1a399ed23b24bcf3b6d06 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Fri, 25 Jan 2019 03:03:26 -0800 Subject: [PATCH] Automatically create snapshot release Summary: This adds some frankly disgusting magic to the bump script to determine the next viable snapshot version and creates a second commit. Reviewed By: jknoxville Differential Revision: D13801765 fbshipit-source-id: 40728afe9dfde3da7a4fced645a89ed293109878 --- scripts/bump-version.sh | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/scripts/bump-version.sh b/scripts/bump-version.sh index b9bba840c..d61a2bbb1 100755 --- a/scripts/bump-version.sh +++ b/scripts/bump-version.sh @@ -46,6 +46,10 @@ OLD_VERSION="${OLD_VERSION_POD_ARG##* }" echo "The currently released version is $OLD_VERSION. What should the version of the next release be?" read -r VERSION +# This could be one expression with GNU sed, but I guess we want to support the BSD crap, too. +SNAPSHOT_MINOR_VERSION=$(echo "$VERSION" | sed -Ee 's/([0-9]+)\.([0-9]+)\.([0-9]+)/\3 + 1/' | bc) +SNAPSHOT_VERSION="$(echo "$VERSION" | sed -Ee 's/([0-9]+)\.([0-9]+)\.([0-9]+)/\1.\2./')""$SNAPSHOT_MINOR_VERSION""-SNAPSHOT" + echo "Updating version $VERSION in podspecs, podfiles and in getting started docs..." # Update Podspec files and podfiles with correct version @@ -92,7 +96,15 @@ jq '.version = $newVal' --arg newVal "$VERSION" "$SONAR_DIR"/package.json > tmp. echo "Committing the files..." hg addremove -hg commit -m"Flipper Release: v$VERSION" -echo "Preparing diff for your review..." -jf submit -n +hg commit -m "Flipper Release: v$VERSION" + +RELEASE_REV="$(hg log -r . --template "{node}\\n")" + +echo "Release commit made as $RELEASE_REV, creating new snapshot version $SNAPSHOT_VERSION..." +"$SONAR_DIR"/scripts/bump.sh --snapshot "$SNAPSHOT_VERSION" + +hg commit -m "Flipper Bump: v$SNAPSHOT_VERSION" + +echo "Sumitting diffs for review..." +jf submit -n -r.^::.