diff --git a/.github/workflows/android-release.yaml b/.github/workflows/android-release.yaml index 41cb31a3..fad6b7aa 100644 --- a/.github/workflows/android-release.yaml +++ b/.github/workflows/android-release.yaml @@ -70,18 +70,13 @@ jobs: KEYSTORE_FILE: ${{ secrets.KEYSTORE_FILE }} run: echo $KEYSTORE_FILE | base64 -d > my.keystore - - name: Save google-services.json - env: - GOOGLE_SERVICES: ${{ secrets.GOOGLE_SERVICES }} - run: echo "$GOOGLE_SERVICES" > networksurvey/google-services.json - - - name: Build Regular Release APK + - name: Build CDR Release APK env: KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} KEY_ALIAS: ${{ secrets.KEY_ALIAS }} KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} NS_API_KEY: ${{ secrets.NS_API_KEY }} - run: ./gradlew assembleRegularRelease + run: ./gradlew assembleCdrRelease -Pandroid.injected.signing.store.file=$(pwd)/my.keystore -Pandroid.injected.signing.store.password=$KEYSTORE_PASSWORD -Pandroid.injected.signing.key.alias=$KEY_ALIAS @@ -96,30 +91,35 @@ jobs: echo "basename=$base_name" >> "$GITHUB_OUTPUT" echo $base_name - - name: Upload Regular APK + - name: Upload CDR APK uses: actions/upload-artifact@v4 with: - name: Network Survey Regular Release APK - path: networksurvey/build/outputs/apk/regular/release/${{ env.basename }}-regular-release.apk + name: Network Survey CDR Release APK + path: networksurvey/build/outputs/apk/cdr/release/${{ env.basename }}-cdr-release.apk - - name: Build CDR Release APK + - name: Save google-services.json + env: + GOOGLE_SERVICES: ${{ secrets.GOOGLE_SERVICES }} + run: echo "$GOOGLE_SERVICES" > networksurvey/google-services.json + + - name: Build Regular Release APK env: KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} KEY_ALIAS: ${{ secrets.KEY_ALIAS }} KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} NS_API_KEY: ${{ secrets.NS_API_KEY }} - run: ./gradlew assembleCdrRelease + run: ./gradlew assembleRegularRelease -Pandroid.injected.signing.store.file=$(pwd)/my.keystore -Pandroid.injected.signing.store.password=$KEYSTORE_PASSWORD -Pandroid.injected.signing.key.alias=$KEY_ALIAS -Pandroid.injected.signing.key.password=$KEY_PASSWORD -PnsApiKey=$NS_API_KEY - - name: Upload CDR APK + - name: Upload Regular APK uses: actions/upload-artifact@v4 with: - name: Network Survey CDR Release APK - path: networksurvey/build/outputs/apk/cdr/release/${{ env.basename }}-cdr-release.apk + name: Network Survey Regular Release APK + path: networksurvey/build/outputs/apk/regular/release/${{ env.basename }}-regular-release.apk - name: Build Regular Release Bundle env: diff --git a/build.gradle b/build.gradle index 057f354c..e328243d 100644 --- a/build.gradle +++ b/build.gradle @@ -3,6 +3,7 @@ buildscript { ext.kotlin_version = '1.9.21' ext.hilt_version = '2.51.1' + ext.useCrashlytics = file("networksurvey/google-services.json").exists() repositories { google() mavenCentral() @@ -10,8 +11,10 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:8.5.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath 'com.google.gms:google-services:4.4.2' - classpath 'com.google.firebase:firebase-crashlytics-gradle:3.0.2' + if (useCrashlytics) { + classpath 'com.google.gms:google-services:4.4.2' + classpath 'com.google.firebase:firebase-crashlytics-gradle:3.0.2' + } classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.7.7" classpath "com.google.dagger:hilt-android-gradle-plugin:$hilt_version" }