From f469450ca4d2c58d7bd34ba3f8f635070de60c45 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 5 Jul 2022 16:07:12 +0200 Subject: [PATCH 01/13] Setup `nightly` buildType --- gradle.properties | 5 +++++ vector/build.gradle | 14 ++++++++++++++ vector/signature/nightly.keystore | Bin 0 -> 2217 bytes 3 files changed, 19 insertions(+) create mode 100644 vector/signature/nightly.keystore diff --git a/gradle.properties b/gradle.properties index 6de52be607..2af9214ed5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -32,3 +32,8 @@ signing.element.storePath=pathTo.keystore signing.element.storePassword=Secret signing.element.keyId=Secret signing.element.keyPassword=Secret + +# Dummy values for signing secrets / nightly +signing.element.nightly.storePassword=Secret +signing.element.nightly.keyId=Secret +signing.element.nightly.keyPassword=Secret diff --git a/vector/build.gradle b/vector/build.gradle index dd160f9574..45f1178c44 100644 --- a/vector/build.gradle +++ b/vector/build.gradle @@ -228,6 +228,12 @@ android { storeFile file('./signature/debug.keystore') storePassword 'android' } + nightly { + keyAlias project.property("signing.element.nightly.keyId") + keyPassword project.property("signing.element.nightly.keyPassword") + storeFile file('./signature/nightly.keystore') + storePassword project.property("signing.element.nightly.storePassword") + } release { keyAlias project.property("signing.element.keyId") keyPassword project.property("signing.element.keyPassword") @@ -268,6 +274,14 @@ android { } // signingConfig signingConfigs.release } + + nightly { + initWith release + applicationIdSuffix ".nightly" + resValue "string", "app_name", "Element nightly" + + signingConfig signingConfigs.nightly + } } flavorDimensions "store" diff --git a/vector/signature/nightly.keystore b/vector/signature/nightly.keystore new file mode 100644 index 0000000000000000000000000000000000000000..a0e9ba413be5ac9bb0b30a3088882a17c5aaa3bd GIT binary patch literal 2217 zcmchYX*3iH8^>oem@$~Lz9mLsm@s3@5;As@{hG*bFbK(#vSbu8L%gh&woO@0m-p}uc=fm@Ro)6FYpXdDlhpUIH0001VT)@8z=1+_a zB>DJ;21FjCxZ$b?G5`Pv0856jvAj?i1`31#UvkOKfAL%zCfsf@3k=4}x5b~?zt zS>4={6p7gyxhG_MH3I1zfN#teA(S*?B|lTZoZwGcKpAO{|6-@9w&bn|X7I6X9UW zGgo>k|S7|o`+xSx=*lAdWp;Q=Ux zA15drh_my;U4+SN9d9q4lp33dhOd*Z2-MkY1(9tRT}NpRtom%KN$z0kq@Qx(Qx3jOKDu&89wDBwS>C>K zS}=#~WW1Q_Ua44H(YPiwqf0TU;Nkz2{~b7L{7e91 zDnhYF?ifpSL=LCu7~go8I~nC4>SyT4=ExsBYBF!B5-)stlTsD6Vj4`65+38(wJVmL z5FUZVNEkcR2k7;Spb8PKQ-R&l6{@;9oXMSt0UusGY0oQ}uE}+M#)|pXMMnjd8$kRG zUz2sw_H_aK$51fLx1}JEtjzS5x)IjqO!|34JxKp4)wll0EICK(_LY>TFjd(#FIm|Q zhr#WvD${`dCl1*=%8Wy!6Zi|K|BdGEEl=cw8#)%!(vr*$OKG+qDcr_v zK1@cgFC=1vvH#XNRWx7TR{<1K%5w^!FnuP(Wb@_K0xS7yJc(k?~D86QxgZyXHs zP__BqigJ!iCDVP=fP6;qM&H%+XvXK6VT*QH9`8!?1NfUg*3L>a0@t}%F7LkB=B5Ua zNt-w~w!LLLmCJugKkmK$Gk*&vyG+Aqo8@?yS{M)V`$hAY2h1O z4DKQ&LA36JPa;Ahr;$Mf_ggiziYEzC`cDtfw>FiK52$hxJm2|WJ*Q|k7H{pZKxuQ$ z=!ELXK=<$ZyBn5QgEJ9dq;Ci+l5W3~p_OJLz(r0@^%<43J?e#E$30=rjcgjuGA+wG%m39=L zE*cLdVro=R}*3L|u$9X;XEMI^9w>NSS6jZSq007tp zO9ne)$sl|I7z6}?ARbHu0u}+~mP;^6*g*h+@MFUa#KE!LP_R7&dJ<%0gX24%A2(b) zP@@p{Ku_X7fRhJmLktWg-o%~6BLBMq%q zs^V0zN?5F;2%i#G^;htJzlaQ!{8g0W!~m0le8*7&gn`IFAfV!9WH+`4Z!T?In;Z#G z62JC(0rh*4Mo=sA9p~L^3!Gy*GLO^@LPNtoNXhFx8*6DOH8Ib^Cu{F|ZRTGuQu)^; zYv6KT)8&Q4lQY+8%RK?rA+cxsJ%co&<0tcDMzHj%Cgvs@9@^kSNEVl#Qv-d?CKSt@ zY<7{DYmbTq_LHY)pT4G_yT33Ntk7f^qCviL5!N5JUu-X54*D}qD^5`3eIq}IuXw57 z`cAP2(SwBy;P<25qJ=2)(@$|d+HpHP*y{@Q9k+%}lwZWVW=uFo7rrHqhX!9Qr3$5k zA@?>1`I5c&Rv|_RZ#Zwg6ryurN&g0YdzV}kF$8v+q#!|fF6h)Vz)lUEIv|)hv!(< zHU^_&BM);E!{t|J+j-x3!aKBF_p9iv?d-%|D{ac_9sF&gbX!p(Pk7OK_qTK3ZMbz< zcX(;uW9{M7+e0dKYGW2P=>q Date: Tue, 5 Jul 2022 16:09:18 +0200 Subject: [PATCH 02/13] Add google-services.json for nightly builds --- vector/src/gplay/nightly/google-services.json | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 vector/src/gplay/nightly/google-services.json diff --git a/vector/src/gplay/nightly/google-services.json b/vector/src/gplay/nightly/google-services.json new file mode 100644 index 0000000000..4cfa4dc036 --- /dev/null +++ b/vector/src/gplay/nightly/google-services.json @@ -0,0 +1,40 @@ +{ + "project_info": { + "project_number": "912726360885", + "firebase_url": "https://vector-alpha.firebaseio.com", + "project_id": "vector-alpha", + "storage_bucket": "vector-alpha.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:912726360885:android:4ef8f3a0021e774d", + "android_client_info": { + "package_name": "im.vector.app.nightly" + } + }, + "oauth_client": [ + { + "client_id": "912726360885-e87n3jva9uoj4vbidvijq78ebg02asv2.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyAFZX8IhIfgzdOZvxDP_ISO5WYoU7jmQ5c" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "912726360885-rsae0i66rgqt6ivnudu1pv4tksg9i8b2.apps.googleusercontent.com", + "client_type": 3 + } + ] + } + } + } + ], + "configuration_version": "1" +} From 8434fb9a6476feb22252df8244768f353ce2caf1 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 5 Jul 2022 16:11:44 +0200 Subject: [PATCH 03/13] Add fallback for submodules --- vector/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vector/build.gradle b/vector/build.gradle index 45f1178c44..5a34196893 100644 --- a/vector/build.gradle +++ b/vector/build.gradle @@ -279,7 +279,7 @@ android { initWith release applicationIdSuffix ".nightly" resValue "string", "app_name", "Element nightly" - + matchingFallbacks = ['release'] signingConfig signingConfigs.nightly } } From ea5b2b34339428b800735beddb31015ffe039734 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 6 Jul 2022 15:36:01 +0200 Subject: [PATCH 04/13] Add sources for nightly. Use release version, change AnalyticsConfig.kt and shortcuts.xml. --- vector/build.gradle | 4 ++++ vector/src/nightly/res/xml/shortcuts.xml | 7 +++++++ .../release/java/im/vector/app/config/AnalyticsConfig.kt | 7 ++++++- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 vector/src/nightly/res/xml/shortcuts.xml diff --git a/vector/build.gradle b/vector/build.gradle index 5a34196893..7bdc496c91 100644 --- a/vector/build.gradle +++ b/vector/build.gradle @@ -348,6 +348,10 @@ android { test { java.srcDirs += "src/sharedTest/java" } + // Add sourceSets for `release` version when building `nightly` + nightly { + java.srcDirs += "src/release/java" + } } buildFeatures { diff --git a/vector/src/nightly/res/xml/shortcuts.xml b/vector/src/nightly/res/xml/shortcuts.xml new file mode 100644 index 0000000000..f3056d0f8c --- /dev/null +++ b/vector/src/nightly/res/xml/shortcuts.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/vector/src/release/java/im/vector/app/config/AnalyticsConfig.kt b/vector/src/release/java/im/vector/app/config/AnalyticsConfig.kt index 7f7ef1a54e..e1427338b2 100644 --- a/vector/src/release/java/im/vector/app/config/AnalyticsConfig.kt +++ b/vector/src/release/java/im/vector/app/config/AnalyticsConfig.kt @@ -19,8 +19,13 @@ package im.vector.app.config import im.vector.app.BuildConfig import im.vector.app.features.analytics.AnalyticsConfig +private val allowedPackageList = listOf( + "im.vector.app", + "im.vector.app.nightly", +) + val analyticsConfig: AnalyticsConfig = object : AnalyticsConfig { - override val isEnabled = BuildConfig.APPLICATION_ID == "im.vector.app" + override val isEnabled = BuildConfig.APPLICATION_ID in allowedPackageList override val postHogHost = "https://posthog.hss.element.io" override val postHogApiKey = "phc_Jzsm6DTm6V2705zeU5dcNvQDlonOR68XvX2sh1sEOHO" override val policyLink = "https://element.io/cookie-policy" From a030769aeabeaff32dac3d9a12cfd24b6a49b7a8 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 5 Jul 2022 16:29:47 +0200 Subject: [PATCH 05/13] Change icon background color for nightly build --- vector/build.gradle | 3 +++ vector/src/main/res/drawable/ic_launcher_background.xml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/vector/build.gradle b/vector/build.gradle index 7bdc496c91..a64d64b377 100644 --- a/vector/build.gradle +++ b/vector/build.gradle @@ -246,6 +246,7 @@ android { debug { applicationIdSuffix ".debug" resValue "string", "app_name", "Element dbg" + resValue "color", "launcher_background", "#0DBD8B" buildConfigField "boolean", "LOW_PRIVACY_LOG_ENABLE", "false" // Set to true if you want to enable strict mode in debug @@ -260,6 +261,7 @@ android { release { resValue "string", "app_name", "Element" + resValue "color", "launcher_background", "#0DBD8B" buildConfigField "boolean", "LOW_PRIVACY_LOG_ENABLE", "false" buildConfigField "boolean", "ENABLE_STRICT_MODE_LOGS", "false" @@ -279,6 +281,7 @@ android { initWith release applicationIdSuffix ".nightly" resValue "string", "app_name", "Element nightly" + resValue "color", "launcher_background", "#07007E" matchingFallbacks = ['release'] signingConfig signingConfigs.nightly } diff --git a/vector/src/main/res/drawable/ic_launcher_background.xml b/vector/src/main/res/drawable/ic_launcher_background.xml index f58c9aeb53..0792f1686b 100644 --- a/vector/src/main/res/drawable/ic_launcher_background.xml +++ b/vector/src/main/res/drawable/ic_launcher_background.xml @@ -5,6 +5,6 @@ android:viewportHeight="108"> From 5793a38774101a14d50d53680c39bcd9830a6673 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 5 Jul 2022 17:11:52 +0200 Subject: [PATCH 06/13] Add label for rageshake to know the build type, in particular to know if it's a nightly build. --- .../main/java/im/vector/app/features/rageshake/BugReporter.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vector/src/main/java/im/vector/app/features/rageshake/BugReporter.kt b/vector/src/main/java/im/vector/app/features/rageshake/BugReporter.kt index 09453e5b02..e2e5ee2c6e 100755 --- a/vector/src/main/java/im/vector/app/features/rageshake/BugReporter.kt +++ b/vector/src/main/java/im/vector/app/features/rageshake/BugReporter.kt @@ -346,6 +346,9 @@ class BugReporter @Inject constructor( // Special for Element builder.addFormDataPart("label", "[Element]") + // Possible values for BuildConfig.BUILD_TYPE: "debug", "nightly", "release". + builder.addFormDataPart("label", BuildConfig.BUILD_TYPE) + when (reportType) { ReportType.BUG_REPORT -> { /* nop */ From 388a38010141e4b6aa0a8957e11b6a4fde331eb7 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 5 Jul 2022 17:50:01 +0200 Subject: [PATCH 07/13] Add "-nightly" suffix to version name --- vector/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/vector/build.gradle b/vector/build.gradle index a64d64b377..652f90ab88 100644 --- a/vector/build.gradle +++ b/vector/build.gradle @@ -280,6 +280,7 @@ android { nightly { initWith release applicationIdSuffix ".nightly" + versionNameSuffix "-nightly" resValue "string", "app_name", "Element nightly" resValue "color", "launcher_background", "#07007E" matchingFallbacks = ['release'] From 11b2cd3dc0985398a02f8bf6780a590dfc3b2504 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 6 Jul 2022 00:15:32 +0200 Subject: [PATCH 08/13] Configure Firebase appdistribution plugin --- build.gradle | 1 + vector/build.gradle | 20 +++++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) 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" + } } } From cdaec0e293dbf2b324151b51406f993d61a869a0 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 6 Jul 2022 11:17:03 +0200 Subject: [PATCH 09/13] Add GitHub action to build and publish the nightly build. --- .github/workflows/nightly.yml | 48 +++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/nightly.yml diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 0000000000..483291de1f --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,48 @@ +name: Build and release nightly APK + +on: + schedule: + # Every nights at 4 + - cron: "0 4 * * *" + +env: + CI_GRADLE_ARG_PROPERTIES: > + -Porg.gradle.jvmargs=-Xmx4g + -Porg.gradle.parallel=false + --no-daemon + +jobs: + nightly: + name: Build and publish nightly Gplay APK to Firebase + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.8 + uses: actions/setup-python@v4 + with: + python-version: 3.8 + - uses: actions/cache@v3 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + - name: Install towncrier + run: | + python3 -m pip install towncrier + - name: Prepare changelog file + run: | + mv towncrier.toml towncrier.toml.bak + sed 's/CHANGES\.md/CHANGES_NIGHTLY\.md/' towncrier.toml.bak > towncrier.toml + rm towncrier.toml.bak + yes n | towncrier --version nightly + - name: Build and upload Gplay Nightly APK + run: | + ./gradlew assembleGplayNightly appDistributionUploadGplayNightly $CI_GRADLE_ARG_PROPERTIES --stacktrace + env: + ELEMENT_ANDROID_NIGHTLY_KEYID: ${{ secrets.ELEMENT_ANDROID_NIGHTLY_KEYID }} + ELEMENT_ANDROID_NIGHTLY_KEYPASSWORD: ${{ secrets.ELEMENT_ANDROID_NIGHTLY_KEYPASSWORD }} + ELEMENT_ANDROID_NIGHTLY_STOREPASSWORD: ${{ secrets.ELEMENT_ANDROID_NIGHTLY_STOREPASSWORD }} + FIREBASE_TOKEN: ${{ secrets.ELEMENT_ANDROID_NIGHTLY_FIREBASE_TOKEN }} From 253480fd2b8ea4453966482ea26badca7dd65a95 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 6 Jul 2022 11:08:19 +0200 Subject: [PATCH 10/13] Changelog --- changelog.d/6478.misc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/6478.misc diff --git a/changelog.d/6478.misc b/changelog.d/6478.misc new file mode 100644 index 0000000000..52bc4a011d --- /dev/null +++ b/changelog.d/6478.misc @@ -0,0 +1 @@ +Nightly build publication on Firebase From b3e86129e90465a4726275eb6b6da2203f74a358 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 6 Jul 2022 17:00:09 +0200 Subject: [PATCH 11/13] `initWith release` does not take care of `postprocessing` block, so rather do some copy paste, to avoid a warning about values being replaced --- vector/build.gradle | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/vector/build.gradle b/vector/build.gradle index a4a08c4522..4de97199b4 100644 --- a/vector/build.gradle +++ b/vector/build.gradle @@ -279,11 +279,22 @@ android { } nightly { - initWith release applicationIdSuffix ".nightly" versionNameSuffix "-nightly" resValue "string", "app_name", "Element nightly" resValue "color", "launcher_background", "#07007E" + + buildConfigField "boolean", "LOW_PRIVACY_LOG_ENABLE", "false" + buildConfigField "boolean", "ENABLE_STRICT_MODE_LOGS", "false" + + postprocessing { + removeUnusedCode true + removeUnusedResources true + // We do not activate obfuscation as it makes it hard then to read crash reports, and it's a bit useless on an open source project :) + obfuscate false + optimizeCode true + proguardFiles 'proguard-rules.pro' + } matchingFallbacks = ['release'] signingConfig signingConfigs.nightly firebaseAppDistribution { From 64871e368104e87c8ed90c0262a6ff5dc5460791 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 7 Jul 2022 17:40:48 +0200 Subject: [PATCH 12/13] Add documentation about nightly build. --- docs/nightly_build.md | 54 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 docs/nightly_build.md diff --git a/docs/nightly_build.md b/docs/nightly_build.md new file mode 100644 index 0000000000..91f18214c4 --- /dev/null +++ b/docs/nightly_build.md @@ -0,0 +1,54 @@ +# Nightly builds + + + +* [Configuration](#configuration) +* [How to register to get nightly build](#how-to-register-to-get-nightly-build) +* [Build nightly manually](#build-nightly-manually) + + + +## Configuration + +The nightly build will contain what's on develop, in release mode, for Gplay variant. It is signed using a dedicated signature, and has a dedicated appId (`im.vector.app.nightly`), so it can be installed along with the production version of Element Android. The only other difference compared to Element Android is a different app icon background. We do not want to change the app name since it will also affect some strings in the app, and we do want to do that. + +Nightly builds are built and released to Firebase every days, and automatically. + +This is recommended to exclusively use this app, with your main account, instead of Element Android, and fallback to Element Android just in case of regression, to discover as soon as possible any regression, and report it to the team. To avoid double notification, you may want to disable the notification from the Element Android production version. Just open Element Android, navigate to `Settings/Notifications` and uncheck `Enable notifications for this session`. + +*Note:* Due to a limitation of Firebase, the nightly build is the universal build, which means that the size of the APK is a bit bigger, but this should not have any other side effect. + +## How to register to get nightly build + +Provide your email to the Android team, who will add it to the list "External testers" on Firebase. You will then receive an invite on the provided email. + +Follow the instructions on the email to install the latest nightly build. This is not clear yet if new nightly build will be automatically installed or not. + +## Build nightly manually + +Nightly build can be built manually from your computer. You will need to retrieved some secrets from Passbolt and add them to your file `~/.gradle/gradle.properties`: + +``` +signing.element.nightly.storePassword=VALUE_FROM_PASSBOLT +signing.element.nightly.keyId=VALUE_FROM_PASSBOLT +signing.element.nightly.keyPassword=VALUE_FROM_PASSBOLT +``` + +You will also need to add the environment variable `FIREBASE_TOKEN`: + +```sh +export FIREBASE_TOKEN=VALUE_FROM_PASSBOLT +``` + +Then you can run the following commands (which are also used in the file for [the GitHub action](../.github/workflows/nightly.yml)): + +```sh +git checkout develop +mv towncrier.toml towncrier.toml.bak +sed 's/CHANGES\.md/CHANGES_NIGHTLY\.md/' towncrier.toml.bak > towncrier.toml +rm towncrier.toml.bak +yes n | towncrier --version nightly +./gradlew assembleGplayNightly appDistributionUploadGplayNightly $CI_GRADLE_ARG_PROPERTIES --stacktrace +``` + +Then you can reset the change on the codebase. From 95f4d884617c97dc29972859db1641c3faa450d2 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 7 Jul 2022 17:45:18 +0200 Subject: [PATCH 13/13] Do not alter the app name for the nightly, and finally use `initWith release` to avoid too many copy paste. --- vector/build.gradle | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/vector/build.gradle b/vector/build.gradle index 4de97199b4..f4d4453fb9 100644 --- a/vector/build.gradle +++ b/vector/build.gradle @@ -267,6 +267,7 @@ android { buildConfigField "boolean", "LOW_PRIVACY_LOG_ENABLE", "false" buildConfigField "boolean", "ENABLE_STRICT_MODE_LOGS", "false" + // When updating this block, please also update the same block in the `nightly` buildType below postprocessing { removeUnusedCode true removeUnusedResources true @@ -281,12 +282,12 @@ android { nightly { applicationIdSuffix ".nightly" versionNameSuffix "-nightly" - resValue "string", "app_name", "Element nightly" + + initWith release + // Just override the background color of the launcher icon for the nightly build. resValue "color", "launcher_background", "#07007E" - buildConfigField "boolean", "LOW_PRIVACY_LOG_ENABLE", "false" - buildConfigField "boolean", "ENABLE_STRICT_MODE_LOGS", "false" - + // We need to copy paste this block, this is not done automatically by `initWith release` postprocessing { removeUnusedCode true removeUnusedResources true