Wave 3 (#3): POSIX grep in versionCode check (no PCRE on runner)
This commit is contained in:
1 parent
316b4e6055
commit
ed769b0c4a
1 file changed
+2
-2
@@ -126,10 +126,10 @@ jobs:
|
||||
# Android/Obtainium refuse to install over an equal-or-lower versionCode,
|
||||
# so a tag without a bump would strand users on the old build.
|
||||
run: |
|
||||
CUR=$(grep -oP 'versionCode \K[0-9]+' android/app/build.gradle | head -1)
|
||||
CUR=$(grep -oE 'versionCode [0-9]+' android/app/build.gradle | grep -oE '[0-9]+' | head -1)
|
||||
PREV_TAG=$(git tag --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -2 | tail -1)
|
||||
if [ -n "$PREV_TAG" ]; then
|
||||
PREV=$(git show "$PREV_TAG:android/app/build.gradle" | grep -oP 'versionCode \K[0-9]+' | head -1)
|
||||
PREV=$(git show "$PREV_TAG:android/app/build.gradle" | grep -oE 'versionCode [0-9]+' | grep -oE '[0-9]+' | head -1)
|
||||
echo "versionCode: $PREV ($PREV_TAG) -> $CUR (${GITHUB_REF_NAME})"
|
||||
[ "$CUR" -gt "$PREV" ] || { echo "::error::Bump versionCode in android/app/build.gradle above $PREV before tagging"; exit 1; }
|
||||
else
|
||||
|
||||
Reference in new issue
Block a user