diff --git a/build.gradle b/build.gradle index 61027a0bff..e8472097d5 100644 --- a/build.gradle +++ b/build.gradle @@ -24,6 +24,7 @@ buildscript { classpath libs.gradle.gradlePlugin classpath libs.gradle.kotlinPlugin classpath libs.gradle.hiltPlugin + classpath 'com.google.firebase:firebase-appdistribution-gradle:3.0.2' classpath 'com.google.gms:google-services:4.3.13' classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.4.0.2513' classpath 'com.google.android.gms:oss-licenses-plugin:0.10.5' diff --git a/vector/build.gradle b/vector/build.gradle index 652f90ab88..a4a08c4522 100644 --- a/vector/build.gradle +++ b/vector/build.gradle @@ -1,6 +1,7 @@ import com.android.build.OutputFile apply plugin: 'com.android.application' +apply plugin: 'com.google.firebase.appdistribution' apply plugin: 'com.google.android.gms.oss-licenses-plugin' apply plugin: 'kotlin-android' apply plugin: 'kotlin-parcelize' @@ -229,10 +230,10 @@ android { storePassword 'android' } nightly { - keyAlias project.property("signing.element.nightly.keyId") - keyPassword project.property("signing.element.nightly.keyPassword") + keyAlias System.env.ELEMENT_ANDROID_NIGHTLY_KEYID ?: project.property("signing.element.nightly.keyId") + keyPassword System.env.ELEMENT_ANDROID_NIGHTLY_KEYPASSWORD ?: project.property("signing.element.nightly.keyPassword") storeFile file('./signature/nightly.keystore') - storePassword project.property("signing.element.nightly.storePassword") + storePassword System.env.ELEMENT_ANDROID_NIGHTLY_STOREPASSWORD ?: project.property("signing.element.nightly.storePassword") } release { keyAlias project.property("signing.element.keyId") @@ -285,6 +286,19 @@ android { resValue "color", "launcher_background", "#07007E" matchingFallbacks = ['release'] signingConfig signingConfigs.nightly + firebaseAppDistribution { + artifactType = "APK" + // We upload the universal APK to fix this error: + // "App Distribution found more than 1 output file for this variant. + // Please contact firebase-support@google.com for help using APK splits with App Distribution." + artifactPath = "$rootDir/vector/build/outputs/apk/gplay/nightly/vector-gplay-universal-nightly.apk" + // This file will be generated by the GitHub action + releaseNotesFile = "CHANGES_NIGHTLY.md" + groups = "external-testers" + // This should not be required, but if I do not add the appId, I get this error: + // "App Distribution halted because it had a problem uploading the APK: [404] Requested entity was not found." + appId = "1:912726360885:android:efd8545af52a9f9300427c" + } } }