From 4327e4ca52185e4f5348aead0c2c849b8076e3b7 Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Sun, 25 Sep 2022 11:10:46 +0200 Subject: [PATCH] Refine beta commit script - Ensure API pull succeeds (do it early) - Include base build number --- .beta-base | 2 +- scripts/commit-beta.sh | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.beta-base b/.beta-base index b1e1a0c0..b065a3fa 100644 --- a/.beta-base +++ b/.beta-base @@ -1 +1 @@ -1120 +1123 diff --git a/scripts/commit-beta.sh b/scripts/commit-beta.sh index a46e94a0..3991a0d3 100755 --- a/scripts/commit-beta.sh +++ b/scripts/commit-beta.sh @@ -5,10 +5,18 @@ if [[ $CURRENT_BRANCH != "master" ]]; then exit 1 fi +# pull latest API +API_PATH="PassepartoutLibrary/Sources/PassepartoutServices/API" +if ! git -C $API_PATH pull origin master; then + echo "Could not pull API" + exit 1 +fi +git add $API_PATH + # set build number -BASE_BUILD_NUMBER=`cat .beta-base` +BASE_BUILD_FILE=".beta-base" BUILD_FILE=".beta-build" -BUILD=$((BASE_BUILD_NUMBER + `git rev-list HEAD --count` + 1)) +BUILD=$((`cat $BASE_BUILD_FILE` + `git rev-list HEAD --count` + 1)) ci/set-build.sh $BUILD echo $BUILD >$BUILD_FILE @@ -18,13 +26,8 @@ ci/update-release-notes.sh ios && ci/copy-release-notes.sh ios && ci/copy-release-notes.sh mac -# pull latest API -API_PATH="PassepartoutLibrary/Sources/PassepartoutServices/API" -git -C $API_PATH pull origin master -git add $API_PATH - # add build number -git add $BUILD_FILE +git add $BASE_BUILD_FILE $BUILD_FILE git add Passepartout.xcodeproj git add *.plist