From 7f5f5f459d02965e91ea5e09faa3736756d05c46 Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Fri, 16 Feb 2024 14:06:29 +0100 Subject: [PATCH] wip release script --- scripts/ios/release.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/scripts/ios/release.sh b/scripts/ios/release.sh index b58902e90..044b290ee 100755 --- a/scripts/ios/release.sh +++ b/scripts/ios/release.sh @@ -9,5 +9,20 @@ DIR="$( cd "$( dirname "$REL_DIR" )" && pwd )"; ZIP_PATH=$(sh $DIR/build-sargon.sh --release | tail -n 1) +`git fetch --prune --tags` +function last_tag() { + local out=`git tag --sort=taggerdate | tail -1` + echo $out +} +echo "🔮 Last tag: $(last_tag)" -gh release \ No newline at end of file +# one liner from: https://stackoverflow.com/a/8653732 +NEXT_TAG=$(echo $(last_tag) | awk -F. -v OFS=. 'NF==1{print ++$NF}; NF>1{if(length($NF+1)>length($NF))$(NF-1)++; $NF=sprintf("%0*d", length($NF), ($NF+1)%(10^length($NF))); print}') + +`git tag $NEXT_TAG` +echo "🔮 Last tag: $(last_tag)" +RELEASE_CMD="gh release create $NEXT_TAG $ZIP_PATH" +echo "📦 will now run command: '$RELEASE_CMD'" +eval $RELEASE_CMD + +echo "End of script ✅" \ No newline at end of file