Skip to content

Commit

Permalink
Test with git push
Browse files Browse the repository at this point in the history
  • Loading branch information
alfons-caroles-rocketlab committed Jul 21, 2022
1 parent 825a6b9 commit 94f6e93
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 14 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/android_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 '[email protected]'
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
Expand Down
34 changes: 22 additions & 12 deletions script.sh
Original file line number Diff line number Diff line change
@@ -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"

Expand Down Expand Up @@ -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 "[email protected]"
# 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"
Expand Down

0 comments on commit 94f6e93

Please sign in to comment.