diff --git a/.github/workflows/android-build.yml b/.github/workflows/android-build.yml index 4ca389421e..7920396235 100644 --- a/.github/workflows/android-build.yml +++ b/.github/workflows/android-build.yml @@ -15,7 +15,7 @@ jobs: matrix: build: [default, lite] env: - FILES: | + LITES: | app/src/main/AndroidManifest.xml app/src/main/java/org/ole/planet/myplanet/base/PermissionActivity.kt app/src/main/java/org/ole/planet/myplanet/base/BaseContainerFragment.kt @@ -30,7 +30,7 @@ jobs: - name: check for .lite diffs if: matrix.build == 'lite' run: | - echo "${{ env.FILES }}" | xargs -n 1 | while read file; do + echo "${{ env.LITES }}" | xargs -n 1 | while read file; do ls -al $file* diff "$file" "$file.lite" || true done @@ -52,12 +52,12 @@ jobs: - name: diff the code to get lite if: matrix.build == 'lite' run: | - echo "${{ env.FILES }}" | xargs -n 1 | while read file; do + ls -al app/build.gradle + sed -i 's/\(versionName "[0-9.]\+\)"/\1-lite"/' app/build.gradle + echo "${{ env.LITES }}" | 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 a63f98508b..4e5b487e8c 100644 --- a/.github/workflows/android-release.yml +++ b/.github/workflows/android-release.yml @@ -15,11 +15,16 @@ jobs: matrix: build: [default, lite] env: - FILES: | + LITES: | app/src/main/AndroidManifest.xml app/src/main/java/org/ole/planet/myplanet/base/PermissionActivity.kt app/src/main/java/org/ole/planet/myplanet/base/BaseContainerFragment.kt app/src/main/java/org/ole/planet/myplanet/ui/dashboard/DashboardActivity.kt + OUTPUTS: | + .apk + .apk.sha256 + .aab + .aab.sha256 steps: - name: checkout repository code @@ -44,13 +49,13 @@ jobs: - name: diff the code to get lite if: matrix.build == 'lite' run: | - echo "${{ env.FILES }}" | xargs -n 1 | while read file; do + echo ANDROID_VERSION_LITE=$(grep -oP 'versionName "\K[^\"]+' app/build.gradle) >> $GITHUB_ENV + ls -al app/build.gradle + sed -i 's/\(versionName "[0-9.]\+\)"/\1-lite"/' app/build.gradle + echo "${{ env.LITES }}" | 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: | @@ -108,12 +113,11 @@ 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 + echo "${{ env.OUTPUTS }}" | xargs -n 1 | while read type; do + mv "output/myPlanet${type}" "output/myPlanet-${{ env.ANDROID_VERSION_NAME }}-${GITHUB_REF##*/}${type}" + done ls -alR output + echo "BRANCHNAME=${GITHUB_REF##*/}" >> $GITHUB_ENV - name: upload APK and AAB as build artifact if: github.event_name == 'workflow_dispatch' @@ -126,10 +130,9 @@ jobs: - name: pre-process files and tag for lite version if: github.event_name != 'workflow_dispatch' && matrix.build == 'lite' run: | - mv output/myPlanet.apk output/myPlanet-lite.apk - 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 "${{ env.OUTPUTS }}" | xargs -n 1 | while read type; do + mv "output/myPlanet${type}" "output/myPlanet-lite${type}" + done echo "ANDROID_VERSION_NAME=${ANDROID_VERSION_LITE}" >> $GITHUB_ENV - name: release APK and AAB on GitHub diff --git a/app/build.gradle b/app/build.gradle index 62d8b3212d..1b6dd62cec 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,8 +9,8 @@ android { applicationId "org.ole.planet.myplanet" minSdkVersion 21 targetSdkVersion 34 - versionCode 1651 - versionName "0.16.51" + versionCode 1652 + versionName "0.16.52" ndkVersion '21.3.6528147' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true