Skip to content

Commit

Permalink
Merge pull request #3130 from element-hq/feature/bma/fixElementEnterp…
Browse files Browse the repository at this point in the history
…riseNightly

Fix Element Enterprise nightly build and publication using App Distribution
  • Loading branch information
bmarty authored Jul 2, 2024
2 parents 37eaa5e + 0d8064b commit 4757aac
Show file tree
Hide file tree
Showing 12 changed files with 53 additions and 39 deletions.
9 changes: 0 additions & 9 deletions .github/workflows/nightly_enterprise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,6 @@ jobs:
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '17'
- 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 build --version nightly
- name: Build and upload Nightly application
run: |
./gradlew assembleGplayNightly appDistributionUploadGplayNightly $CI_GRADLE_ARG_PROPERTIES
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/copyright/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,18 @@ android {
// artifactType = "AAB"
// artifactPath = "$rootDir/app/build/outputs/bundle/nightly/app-nightly.aab"
releaseNotesFile = "tools/release/ReleaseNotesNightly.md"
groups = "external-testers"
groups = if (isEnterpriseBuild) {
"enterprise-testers"
} else {
"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:e17435e0beb0303000427c"
appId = if (isEnterpriseBuild) {
"1:912726360885:android:3f7e1fe644d99d5a00427c"
} else {
"1:912726360885:android:e17435e0beb0303000427c"
}
}
}
}
Expand Down
8 changes: 0 additions & 8 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,9 @@
android:name="androidx.startup.InitializationProvider"
android:authorities="${applicationId}.androidx-startup"
android:exported="false">

<meta-data
android:name='androidx.lifecycle.ProcessLifecycleInitializer'
android:value='androidx.startup' />

</provider>

<activity
Expand Down Expand Up @@ -146,12 +144,6 @@
</intent-filter>
</activity-alias>

<provider
android:name="androidx.startup.InitializationProvider"
android:authorities="${applicationId}.androidx-startup"
android:exported="false"
tools:node="remove" />

<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileprovider"
Expand Down
2 changes: 1 addition & 1 deletion docs/nightly_build.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Then you can run the following commands (which are also used in the file for [th

```sh
git checkout develop
./gradlew assembleGplayNightly appDistributionUploadGplayNightly $CI_GRADLE_ARG_PROPERTIES
./gradlew assembleGplayNightly appDistributionUploadGplayNightly
```

Then you can reset the change on the codebase.
2 changes: 1 addition & 1 deletion libraries/pushproviders/firebase/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

In order to make this module only know about Firebase, the plugin `com.google.gms.google-services` has been disabled from the `app` module.

To be able to change the values in the file `firebase.xml` from this module, you should enable the plugin `com.google.gms.google-services` again, copy the file `google-services.json` to the folder `/app/src/main`, build the project, and check the generated file `app/build/generated/res/google-services/<buildtype>/values/values.xml` to import the generated values into the `firebase.xml` files.
To be able to change the values set to `google_app_id` in the file `build.gradle.kts` of this module, you should enable the plugin `com.google.gms.google-services` again, copy the file `google-services.json` to the folder `/app/src/main`, build the project, and check the generated file `app/build/generated/res/google-services/<buildtype>/values/values.xml` to import the generated values into the `build.gradle.kts` files.
39 changes: 38 additions & 1 deletion libraries/pushproviders/firebase/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

@file:Suppress("UnstableApiUsage")

plugins {
id("io.element.android-library")
alias(libs.plugins.anvil)
Expand All @@ -22,9 +25,43 @@ android {
namespace = "io.element.android.libraries.pushproviders.firebase"

buildTypes {
release {
getByName("release") {
isMinifyEnabled = true
consumerProguardFiles("consumer-proguard-rules.pro")
resValue(
type = "string",
name = "google_app_id",
value = if (isEnterpriseBuild) {
"1:912726360885:android:d273c2077ec3291500427c"
} else {
"1:912726360885:android:d097de99a4c23d2700427c"
}
)
}
getByName("debug") {
resValue(
type = "string",
name = "google_app_id",
value = if (isEnterpriseBuild) {
"1:912726360885:android:f8de9126a94143d300427c"
} else {
"1:912726360885:android:def0a4e454042e9b00427c"
}
)
}
register("nightly") {
isMinifyEnabled = true
consumerProguardFiles("consumer-proguard-rules.pro")
matchingFallbacks += listOf("release")
resValue(
type = "string",
name = "google_app_id",
value = if (isEnterpriseBuild) {
"1:912726360885:android:3f7e1fe644d99d5a00427c"
} else {
"1:912726360885:android:e17435e0beb0303000427c"
}
)
}
}
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions tools/release/ReleaseNotesNightly.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Element X Android nightly build

See which PRs have been merged recently here:

https://github.com/element-hq/element-x-android/pulls?q=is%3Apr+sort%3Aupdated-desc+is%3Aclosed

0 comments on commit 4757aac

Please sign in to comment.