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
This commit is contained in:
Pascal Hartig
2019-01-25 03:03:26 -08:00
committed by Facebook Github Bot
parent 685be44187
commit 2fd9bac31c

View File

@@ -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
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.^::.