From 3dfaeb1f2f37ebe33ba4163b66e50fbd58b23892 Mon Sep 17 00:00:00 2001 From: Hiddify Date: Sat, 20 Jan 2024 18:10:46 +0100 Subject: [PATCH] fix: versioning issue in ios singbox platform extension --- Makefile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index bcbb10b3..2b62be95 100644 --- a/Makefile +++ b/Makefile @@ -137,7 +137,11 @@ release: # Create a new tag for release. @echo "previous version was $$(git describe --tags $$(git rev-list --tags --max-count=1))" @echo "WARNING: This operation will creates version tag and push to github" @bash -c '\ - read -p "Version? (provide the next x.y.z semver) : " TAG && \ + cversion_string=`grep -e "^version:" pubspec.yaml | cut -d: -f2-`; \ + cstr_version=`echo "$${cversion_string}" | sed -n "s/[ ]*\\([0-9]\\+\\.[0-9]\\+\\.[0-9]\\+\\)+.*/\\1/p"`; \ + cbuild_number=`echo "$${cversion_string}" | sed -n "s/.*+\\([0-9]\\+\\)/\\1/p"`; \ + echo "Current Version Name:$${cstr_version} Build Number:$${cbuild_number}";\ + read -p "new Version? (provide the next x.y.z semver) : " TAG && \ echo $$TAG &&\ [[ "$$TAG" =~ ^[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}(\.dev)?$$ ]] || { echo "Incorrect tag. e.g., 1.2.3 or 1.2.3.dev"; exit 1; } && \ IFS="." read -r -a VERSION_ARRAY <<< "$$TAG" && \ @@ -145,9 +149,9 @@ release: # Create a new tag for release. BUILD_NUMBER=$$(( $${VERSION_ARRAY[0]} * 10000 + $${VERSION_ARRAY[1]} * 100 + $${VERSION_ARRAY[2]} )) && \ echo "version: $${VERSION_STR}+$${BUILD_NUMBER}" && \ sed -i "s/^version: .*/version: $${VERSION_STR}\+$${BUILD_NUMBER}/g" pubspec.yaml && \ - git tag $${TAG} > /dev/null && \ - git tag -d $${TAG} > /dev/null && \ - git add pubspec.yaml CHANGELOG.md && \ + sed -i "s/CURRENT_PROJECT_VERSION = $${cbuild_number}/CURRENT_PROJECT_VERSION = $${BUILD_NUMBER}/g" ios/Runner.xcodeproj/project.pbxproj && \ + sed -i "s/MARKETING_VERSION = $${cstr_version}/MARKETING_VERSION = $${VERSION_STR}/g" ios/Runner.xcodeproj/project.pbxproj && \ + git add ios/Runner.xcodeproj/project.pbxproj pubspec.yaml&& \ git commit -m "release: version $${TAG}" && \ echo "creating git tag : v$${TAG}" && \ git tag v$${TAG} && \