Skip to content

Commit

Permalink
Don't add GMS and crashlytics to the classpath unless the google-serv…
Browse files Browse the repository at this point in the history
…ices.json file is present
  • Loading branch information
christianrowlands committed Sep 25, 2024
1 parent 73449e4 commit 1d6f8b7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/android-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
7 changes: 5 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@
buildscript {
ext.kotlin_version = '1.9.21'
ext.hilt_version = '2.51.1'
ext.useCrashlytics = file("networksurvey/google-services.json").exists()
repositories {
google()
mavenCentral()
}
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"
}
Expand Down

0 comments on commit 1d6f8b7

Please sign in to comment.