diff --git a/.github/workflows/android-release-bundle-ontag.yml b/.github/workflows/android-release-bundle-ontag.yml new file mode 100644 index 00000000..3c40a311 --- /dev/null +++ b/.github/workflows/android-release-bundle-ontag.yml @@ -0,0 +1,88 @@ +name: Create AAB Release Bundle +on: + release: + types: [published] +jobs: + build_android_release_artifacts: + if: ${{ startsWith(github.event.release.tag_name, 'androidRelease') }} + 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 apk + run: ./gradlew :android:app-newm:assembleProductionRelease + + - name: build bundle production + run: ./gradlew :android:app-newm:bundleProduction + + - 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/productionRelease + 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}} 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