diff --git a/.github/workflows/android-build.yml b/.github/workflows/android-build.yml index d761a4939c..4ca389421e 100644 --- a/.github/workflows/android-build.yml +++ b/.github/workflows/android-build.yml @@ -35,16 +35,6 @@ jobs: diff "$file" "$file.lite" || true done - - name: diff the code to get lite - if: matrix.build == 'lite' - run: | - ls -al app/build.gradle - sed -i 's/\(versionName "[0-9.]\+\)"/\1-lite"/' app/build.gradle - echo "${{ env.FILES }}" | xargs -n 1 | while read file; do - ls -al $file* - cp "${file}.lite" "$file" - done - - name: setup JDK 17 uses: actions/setup-java@v4 with: @@ -59,5 +49,15 @@ jobs: cache-read-only: false cache-write-only: false + - name: diff the code to get lite + if: matrix.build == 'lite' + run: | + echo "${{ env.FILES }}" | xargs -n 1 | while read file; do + ls -al $file* + cp "${file}.lite" "$file" + done + ls -al app/build.gradle + sed -i 's/\(versionName "[0-9.]\+\)"/\1-lite"/' app/build.gradle + - name: build debug as test run: ./gradlew assembleDebug --configuration-cache --no-daemon diff --git a/.github/workflows/android-release.yml b/.github/workflows/android-release.yml index b31816b61a..a63f98508b 100644 --- a/.github/workflows/android-release.yml +++ b/.github/workflows/android-release.yml @@ -27,29 +27,6 @@ jobs: with: fetch-depth: 1 - - name: expose version from build.gradle - if: matrix.build == 'lite' - uses: dogi/expose-android-build.gradle-version-code-and-name@v1.0.2 - with: - expose-version-name: 'true' - - - name: diff the code to get lite - if: matrix.build == 'lite' - run: | - echo "ANDROID_VERSION_NAME_ORIG=${ANDROID_VERSION_NAME}" >> $GITHUB_ENV - ls -al app/build.gradle - sed -i 's/\(versionName "[0-9.]\+\)"/\1-lite"/' app/build.gradle - echo "${{ env.FILES }}" | xargs -n 1 | while read file; do - ls -al $file* - cp "${file}.lite" "$file" - done - - - name: expose version from build.gradle - uses: dogi/expose-android-build.gradle-version-code-and-name@v1.0.2 - with: - expose-version-name: 'true' - expose-version-code: 'true' - - name: setup JDK 17 uses: actions/setup-java@v4 with: @@ -64,8 +41,21 @@ jobs: cache-read-only: false cache-write-only: false + - name: diff the code to get lite + if: matrix.build == 'lite' + run: | + echo "${{ env.FILES }}" | xargs -n 1 | while read file; do + ls -al $file* + cp "${file}.lite" "$file" + done + ls -al app/build.gradle + echo ANDROID_VERSION_LITE=$(grep -oP 'versionName "\K[^\"]+' app/build.gradle) >> $GITHUB_ENV + sed -i 's/\(versionName "[0-9.]\+\)"/\1-lite"/' app/build.gradle + - name: build release APK and AAB run: | + echo ANDROID_VERSION_NAME=$(grep -oP 'versionName "\K[^\"]+' app/build.gradle) >> $GITHUB_ENV + echo ANDROID_VERSION_CODE=$(grep versionCode app/build.gradle | sed 's/[^0-9]//g') >> $GITHUB_ENV ./gradlew assembleRelease bundleRelease ls -alR app/build/outputs mkdir -p sign @@ -118,12 +108,12 @@ jobs: - name: rename APK and AAB with version and branch for artifact if: github.event_name == 'workflow_dispatch' run: | + echo "BRANCHNAME=${GITHUB_REF##*/}" >> $GITHUB_ENV mv output/myPlanet.apk output/myPlanet-${{ env.ANDROID_VERSION_NAME }}-${{ env.BRANCHNAME }}.apk mv output/myPlanet.apk.sha256 output/myPlanet-${{ env.ANDROID_VERSION_NAME }}-${{ env.BRANCHNAME }}.apk.sha256 mv output/myPlanet.aab output/myPlanet-${{ env.ANDROID_VERSION_NAME }}-${{ env.BRANCHNAME }}.aab mv output/myPlanet.aab.sha256 output/myPlanet-${{ env.ANDROID_VERSION_NAME }}-${{ env.BRANCHNAME }}.aab.sha256 ls -alR output - echo "BRANCHNAME=${GITHUB_REF##*/}" >> $GITHUB_ENV - name: upload APK and AAB as build artifact if: github.event_name == 'workflow_dispatch' @@ -140,7 +130,7 @@ jobs: mv output/myPlanet.apk.sha256 output/myPlanet-lite.apk.sha256 mv output/myPlanet.aab output/myPlanet-lite.aab mv output/myPlanet.aab.sha256 output/myPlanet-lite.aab.sha256 - echo "ANDROID_VERSION_NAME=${ANDROID_VERSION_NAME_ORIG}" >> $GITHUB_ENV + echo "ANDROID_VERSION_NAME=${ANDROID_VERSION_LITE}" >> $GITHUB_ENV - name: release APK and AAB on GitHub if: github.event_name != 'workflow_dispatch' diff --git a/app/build.gradle b/app/build.gradle index dd0048f339..62d8b3212d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,8 +9,8 @@ android { applicationId "org.ole.planet.myplanet" minSdkVersion 21 targetSdkVersion 34 - versionCode 1650 - versionName "0.16.50" + versionCode 1651 + versionName "0.16.51" ndkVersion '21.3.6528147' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true