From 94f6e93467806a5dd908662a93746c94344efdbe Mon Sep 17 00:00:00 2001 From: alfons caroles Date: Thu, 21 Jul 2022 15:20:56 +1000 Subject: [PATCH] Test with git push --- .github/workflows/android_build.yml | 14 ++++++++++-- script.sh | 34 +++++++++++++++++++---------- 2 files changed, 34 insertions(+), 14 deletions(-) diff --git a/.github/workflows/android_build.yml b/.github/workflows/android_build.yml index 6f16be5..2e3838e 100644 --- a/.github/workflows/android_build.yml +++ b/.github/workflows/android_build.yml @@ -8,12 +8,14 @@ on: jobs: android-build: name: Android Build - runs-on: macos-latest # using ubuntu latest version / or you can use a specific version - # runs-on: ubuntu-latest # using ubuntu latest version / or you can use a specific version + # runs-on: [self-hosted, macOS] # using ubuntu latest version / or you can use a specific version + runs-on: ubuntu-latest # using ubuntu latest version / or you can use a specific version steps: - name: Check out Git repository # clone the repo to local ci workspace uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: set up JDK 11 uses: actions/setup-java@v3 @@ -70,6 +72,14 @@ jobs: - name: Run Increment Script run: ./script.sh + - name: Commit report + run: | + git config --global user.name 'test user' + git config --global user.email 'test-user@users.noreply.github.com' + git commit -am "Increment android version to version 4.1.5" + git --no-pager log --graph -10 --all --color --date=short --pretty=format:"%Cred%x09%h %Creset%ad%Cblue%d %Creset %s %C(bold)(%an)%Creset" + git push + - name: Generate App APK run: | cd android && ./gradlew assembleRelease --no-daemon diff --git a/script.sh b/script.sh index 9a96a54..9d6786c 100644 --- a/script.sh +++ b/script.sh @@ -1,20 +1,19 @@ # need PlistBuddy installed appName=ActionApp appTestName="${appName}Tests" -currentIOSPatchVersion=$(/usr/libexec/PlistBuddy -c "Print :CFBundleVersion" ios/$appName/info.plist) -currentIOSVersion=$(/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" ios/$appName/info.plist) +# currentIOSPatchVersion=$(/usr/libexec/PlistBuddy -c "Print :CFBundleVersion" ios/$appName/info.plist) +# currentIOSVersion=$(/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" ios/$appName/info.plist) currentAndroidVersion=$(cat android/app/build.gradle | grep -m1 'versionName' | cut -d '"' -f2) currentVersionCode=$(cat android/app/build.gradle | grep -m1 'versionCode' | tr -s ' ' | cut -d ' ' -f3) -currentIOSFullVersion="$currentIOSVersion.$currentIOSPatchVersion" -currentIOSMajorVersion=${currentIOSVersion%.*} -currentIOSMinorVersion=${currentIOSVersion##*.} +# currentIOSFullVersion="$currentIOSVersion.$currentIOSPatchVersion" +# currentIOSMajorVersion=${currentIOSVersion%.*} +# currentIOSMinorVersion=${currentIOSVersion##*.} -echo "current ios major version: $currentIOSMajorVersion" -echo "current ios minor version: $currentIOSMinorVersion" -echo "current ios patch version: $currentIOSPatchVersion" -echo "current ios pbxproj patch version: $currentPbxProjPatchVersion" -echo "current ios version: $currentIOSFullVersion" +# echo "current ios major version: $currentIOSMajorVersion" +# echo "current ios minor version: $currentIOSMinorVersion" +# echo "current ios patch version: $currentIOSPatchVersion" +# echo "current ios version: $currentIOSFullVersion" echo "current android version: $currentAndroidVersion" echo "current android version code: $currentVersionCode" @@ -87,12 +86,23 @@ increaseAndroidVersion() { # } increaseAndroidVersion "4.1.5" + +updatedAndroidVersionCode=$(cat android/app/build.gradle | grep -m1 'versionCode' | tr -s ' ' | cut -d ' ' -f3) +updatedAndroidVersion=$(cat android/app/build.gradle | grep -m1 'versionName' | cut -d '"' -f2) + +# git config --global user.email "github.action@rocketlab.com.au" +# git config --global user.name "github action" +# git add android/app/build.gradle +# git commit -m "Increment android version to version ${updatedAndroidVersion}" +# git --no-pager log --graph -10 --all --color --date=short --pretty=format:"%Cred%x09%h %Creset%ad%Cblue%d %Creset %s %C(bold)(%an)%Creset" # updatedIOSPatchVersion=$(/usr/libexec/PlistBuddy -c "Print :CFBundleVersion" ios/$appName/info.plist) # updatedIOSVersion=$(/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" ios/$appName/info.plist) -# updatedAndroidVersionCode=$(cat android/app/build.gradle | grep -m1 'versionCode' | tr -s ' ' | cut -d ' ' -f3) +updatedAndroidVersionCode=$(cat android/app/build.gradle | grep -m1 'versionCode' | tr -s ' ' | cut -d ' ' -f3) +updatedAndroidVersion=$(cat android/app/build.gradle | grep -m1 'versionName' | cut -d '"' -f2) # updatedIOSFullVersion="$updatedIOSVersion.$updatedIOSPatchVersion" # echo "updated ios version: $updatedIOSFullVersion" -# echo "updated android version code: $updatedAndroidVersionCode" +echo "updated android version code: $updatedAndroidVersionCode" +echo "updated android version name: $updatedAndroidVersion" # getVersion() { # currentIOSFullVersion="$currentIOSVersion.$currentIOSPatchVersion" # echo "current ios version: $currentIOSFullVersion"