From 2931a0378c8f43bb45ab16b0a7f4504422d124aa Mon Sep 17 00:00:00 2001 From: Gohan Date: Fri, 27 Sep 2024 01:47:25 -0500 Subject: [PATCH 1/9] Aab action flow --- .../android-release-bundle-ontag.yml | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 .github/workflows/android-release-bundle-ontag.yml diff --git a/.github/workflows/android-release-bundle-ontag.yml b/.github/workflows/android-release-bundle-ontag.yml new file mode 100644 index 00000000..d176f20c --- /dev/null +++ b/.github/workflows/android-release-bundle-ontag.yml @@ -0,0 +1,93 @@ +name: Distribute Android App +on: + push: + pull_request: + - development + paths: + - "android/**" + - "shared/**" + - "buildSrc/**" + - ".github/workflows/android-preview-branch-merge.yml" +jobs: + build_android_debug: + runs-on: ubuntu-latest + environment: production + steps: + - uses: actions/checkout@v2 + + - name: set up JDK 17 + uses: actions/setup-java@v1 + with: + java-version: 17 + + - name: Setup build tool version variable + run: | + BUILD_TOOL_VERSION=$(ls /usr/local/lib/android/sdk/build-tools/ | tail -n 1) + echo "BUILD_TOOL_VERSION=$BUILD_TOOL_VERSION" >> $GITHUB_ENV + echo Last build tool version is: $BUILD_TOOL_VERSION + + - name: Setup local.properties + run: | + echo STAGING_URL="${{ vars.STAGING_URL }}" >> ./local.properties + echo PRODUCTION_URL="${{ vars.PRODUCTION_URL }}" >> ./local.properties + echo GOOGLE_AUTH_CLIENT_ID="${{ vars.GOOGLE_AUTH_CLIENT_ID }}" >> ./local.properties + + echo "RECAPTCHA_SITE_KEY=${{ secrets.RECAPTCHA_SITE_KEY }}" >> ./local.properties + echo "SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}" >> ./local.properties + echo "ANDROID_SENTRY_DSN=${{ secrets.ANDROID_SENTRY_DSN }}" >> ./local.properties + echo "auth.token=${{ secrets.ANDROID_SENTRY_AUTH_TOKEN}}" >> ./sentry.properties + + - name: create google-services.json + env: + GOOGLE_SERVICES_JSON: ${{ vars.GOOGLE_SERVICES_JSON }} + run: echo $GOOGLE_SERVICES_JSON > ./android/app-newm/google-services.json + + - name: build android app + run: ./gradlew :android:app-newm:assembleProductionRelease + + - name: build bundle release + run: ./gradlew bundleRelease + + - uses: r0adkll/sign-android-release@v1 + name: Sign app APK + # ID used to access action output + id: sign_app + with: + releaseDirectory: android/app-newm/build/outputs/apk/production/release + signingKeyBase64: ${{ secrets.SIGNING_KEY }} + alias: ${{ secrets.KEY_ALIAS }} + keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} + keyPassword: ${{ secrets.KEY_PASSWORD }} + env: + BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }} + + - uses: r0adkll/sign-android-release@v1 + name: Sing app bundle + # ID used to access action output + id: sign_aab + with: + releaseDirectory: android/app-newm/build/outputs/bundle/production/release + signingKeyBase64: ${{ secrets.SIGNING_KEY }} + alias: ${{ secrets.KEY_ALIAS }} + keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} + keyPassword: ${{ secrets.KEY_PASSWORD }} + env: + BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }} + + - uses: actions/upload-artifact@v4 + with: + name: apk + path: ${{steps.sign_app.outputs.signedReleaseFile}} + + - uses: actions/upload-artifact@v4 + with: + name: aab + path: ${{steps.sign_aab.outputs.signedReleaseFile}} + + - name: Upload artifact to Firebase App Distribution + uses: wzieba/Firebase-Distribution-Github-Action@v1 + with: + appId: ${{secrets.FIREBASE_ANDROID_APP_ID}} + serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }} + groups: newm-team + file: ${{steps.sign_app.outputs.signedReleaseFile}} From febdfe5bf8066308b26ec612c518fbea11231ccb Mon Sep 17 00:00:00 2001 From: Gohan Date: Fri, 27 Sep 2024 01:51:17 -0500 Subject: [PATCH 2/9] Updating name for new workflow --- .github/workflows/android-release-bundle-ontag.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/android-release-bundle-ontag.yml b/.github/workflows/android-release-bundle-ontag.yml index d176f20c..47527de8 100644 --- a/.github/workflows/android-release-bundle-ontag.yml +++ b/.github/workflows/android-release-bundle-ontag.yml @@ -1,4 +1,4 @@ -name: Distribute Android App +name: Create AAB Release Bundle on: push: pull_request: @@ -7,7 +7,7 @@ on: - "android/**" - "shared/**" - "buildSrc/**" - - ".github/workflows/android-preview-branch-merge.yml" + - ".github/workflows/android-release-bundle-ontag.yml" jobs: build_android_debug: runs-on: ubuntu-latest From 84c7ad76648ced03c6fe5b311644dfc09d875418 Mon Sep 17 00:00:00 2001 From: Gohan Date: Fri, 27 Sep 2024 02:08:29 -0500 Subject: [PATCH 3/9] Updating name for new workflow --- .github/workflows/android-release-bundle-ontag.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/android-release-bundle-ontag.yml b/.github/workflows/android-release-bundle-ontag.yml index 47527de8..eeeea365 100644 --- a/.github/workflows/android-release-bundle-ontag.yml +++ b/.github/workflows/android-release-bundle-ontag.yml @@ -42,11 +42,14 @@ jobs: GOOGLE_SERVICES_JSON: ${{ vars.GOOGLE_SERVICES_JSON }} run: echo $GOOGLE_SERVICES_JSON > ./android/app-newm/google-services.json - - name: build android app + - name: build android apk run: ./gradlew :android:app-newm:assembleProductionRelease + - name: build bundle production + run: ./gradlew :android:app-newm:bundleProduction + - name: build bundle release - run: ./gradlew bundleRelease + run: ./gradlew :android:app-newm:bundleRelease - uses: r0adkll/sign-android-release@v1 name: Sign app APK From ba5c5259dc30ceeb68e6ab403df4762d13520d49 Mon Sep 17 00:00:00 2001 From: Gohan Date: Fri, 27 Sep 2024 02:23:33 -0500 Subject: [PATCH 4/9] Updating name for new workflow --- .github/workflows/android-release-bundle-ontag.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/android-release-bundle-ontag.yml b/.github/workflows/android-release-bundle-ontag.yml index eeeea365..8586ada7 100644 --- a/.github/workflows/android-release-bundle-ontag.yml +++ b/.github/workflows/android-release-bundle-ontag.yml @@ -47,9 +47,6 @@ jobs: - name: build bundle production run: ./gradlew :android:app-newm:bundleProduction - - - name: build bundle release - run: ./gradlew :android:app-newm:bundleRelease - uses: r0adkll/sign-android-release@v1 name: Sign app APK From b695d18110fefbcd1047652b26be0676e9e0a91b Mon Sep 17 00:00:00 2001 From: Gohan Date: Fri, 27 Sep 2024 02:38:37 -0500 Subject: [PATCH 5/9] Update release location --- .github/workflows/android-release-bundle-ontag.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android-release-bundle-ontag.yml b/.github/workflows/android-release-bundle-ontag.yml index 8586ada7..33b505ac 100644 --- a/.github/workflows/android-release-bundle-ontag.yml +++ b/.github/workflows/android-release-bundle-ontag.yml @@ -66,7 +66,7 @@ jobs: # ID used to access action output id: sign_aab with: - releaseDirectory: android/app-newm/build/outputs/bundle/production/release + releaseDirectory: android/app-newm/build/outputs/bundle/production signingKeyBase64: ${{ secrets.SIGNING_KEY }} alias: ${{ secrets.KEY_ALIAS }} keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} From 8db23a18e1c4a7bdebd093d07e778cf644f8b74c Mon Sep 17 00:00:00 2001 From: Gohan Date: Fri, 27 Sep 2024 02:52:10 -0500 Subject: [PATCH 6/9] bingo --- .github/workflows/android-release-bundle-ontag.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android-release-bundle-ontag.yml b/.github/workflows/android-release-bundle-ontag.yml index 33b505ac..b21ffc02 100644 --- a/.github/workflows/android-release-bundle-ontag.yml +++ b/.github/workflows/android-release-bundle-ontag.yml @@ -66,7 +66,7 @@ jobs: # ID used to access action output id: sign_aab with: - releaseDirectory: android/app-newm/build/outputs/bundle/production + releaseDirectory: android/app-newm/build/outputs/bundle/productionRelease signingKeyBase64: ${{ secrets.SIGNING_KEY }} alias: ${{ secrets.KEY_ALIAS }} keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} From 9f022d187305c92004ec4a4a3e69d854feec9c32 Mon Sep 17 00:00:00 2001 From: Gohan Date: Fri, 27 Sep 2024 03:07:17 -0500 Subject: [PATCH 7/9] Add more memory --- .github/workflows/android-release-bundle-ontag.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android-release-bundle-ontag.yml b/.github/workflows/android-release-bundle-ontag.yml index b21ffc02..2ed98fed 100644 --- a/.github/workflows/android-release-bundle-ontag.yml +++ b/.github/workflows/android-release-bundle-ontag.yml @@ -46,7 +46,7 @@ jobs: run: ./gradlew :android:app-newm:assembleProductionRelease - name: build bundle production - run: ./gradlew :android:app-newm:bundleProduction + run: ./gradlew :android:app-newm:bundleProduction -Dorg.gradle.jvmargs="-Xmx4g -XX:MaxPermSize=512m" - uses: r0adkll/sign-android-release@v1 name: Sign app APK From 79390d43e7dc0d7874edbfe59ca698ebf349995d Mon Sep 17 00:00:00 2001 From: Gohan Date: Fri, 27 Sep 2024 09:50:07 -0500 Subject: [PATCH 8/9] Allocate more memory on properties file --- .github/workflows/android-release-bundle-ontag.yml | 2 +- gradle.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/android-release-bundle-ontag.yml b/.github/workflows/android-release-bundle-ontag.yml index 2ed98fed..b21ffc02 100644 --- a/.github/workflows/android-release-bundle-ontag.yml +++ b/.github/workflows/android-release-bundle-ontag.yml @@ -46,7 +46,7 @@ jobs: run: ./gradlew :android:app-newm:assembleProductionRelease - name: build bundle production - run: ./gradlew :android:app-newm:bundleProduction -Dorg.gradle.jvmargs="-Xmx4g -XX:MaxPermSize=512m" + run: ./gradlew :android:app-newm:bundleProduction - uses: r0adkll/sign-android-release@v1 name: Sign app APK diff --git a/gradle.properties b/gradle.properties index 50bdf061..a0ae98b2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ #Gradle -org.gradle.jvmargs=-Xmx2048M -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options\="-Xmx2048M" +org.gradle.jvmargs=-Xmx4096M -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options\="-Xmx4096M" org.gradle.caching=true org.gradle.configuration-cache=true From eb6e8a51f4583ade6c4eddb81405e0b18c12f8e7 Mon Sep 17 00:00:00 2001 From: Gohan Date: Fri, 27 Sep 2024 10:36:49 -0500 Subject: [PATCH 9/9] Update to only run on release --- .github/workflows/android-release-bundle-ontag.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/android-release-bundle-ontag.yml b/.github/workflows/android-release-bundle-ontag.yml index b21ffc02..3c40a311 100644 --- a/.github/workflows/android-release-bundle-ontag.yml +++ b/.github/workflows/android-release-bundle-ontag.yml @@ -1,15 +1,10 @@ name: Create AAB Release Bundle on: - push: - pull_request: - - development - paths: - - "android/**" - - "shared/**" - - "buildSrc/**" - - ".github/workflows/android-release-bundle-ontag.yml" + release: + types: [published] jobs: - build_android_debug: + build_android_release_artifacts: + if: ${{ startsWith(github.event.release.tag_name, 'androidRelease') }} runs-on: ubuntu-latest environment: production steps: