Merge pull request #13259 from keymanapp/fix/android/env-tier

fix(android): Use TIER.md to determine Play Store tier
This commit is contained in:
Darcy Wong 2025-02-17 13:14:37 +07:00 committed by GitHub
commit 549b11e844
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View file

@ -67,6 +67,7 @@ android {
productFlavors {
}
String tier = new File('../../TIER.md').getText('UTF-8').trim();
applicationVariants.all { variant ->
// Append tag to app name to help differentiate versions for app testers:
// - stable builds have no suffix
@ -75,7 +76,7 @@ android {
// - PR builds also have "-test-1234" suffix (where 1234 is PR#)
// Gradle sync will nullify these values, so have a fallback
String appSuffix = ''
String tag = VERSION_TAG ? VERSION_TAG : '-' + new File('../../TIER.md').getText('UTF-8');
String tag = VERSION_TAG ? VERSION_TAG : '-' + tier;
if (tag.startsWithAny("-beta", "beta")) {
appSuffix = ' Beta';
} else if (tag.startsWithAny("-alpha", "alpha")) {
@ -127,7 +128,7 @@ if (env_keys_json_file != null && file(env_keys_json_file).exists()) {
// Deactivate lower conflicting version APKs
resolutionStrategy.set(com.github.triplet.gradle.androidpublisher.ResolutionStrategy.IGNORE)
switch (System.env.TIER) {
switch (String.valueOf(tier)) {
case 'beta':
track.set("beta")
println "TIER set to beta"

View file

@ -54,6 +54,7 @@ android {
productFlavors {
}
String tier = new File('../../../TIER.md').getText('UTF-8').trim();
applicationVariants.all { variant ->
// Adjust output name to "firstvoices-${VERSION_MD}.apk"
variant.outputs.all {
@ -95,7 +96,7 @@ if (env_keys_json_file != null && file(env_keys_json_file).exists()) {
// Deactivate lower conflicting version APKs
resolutionStrategy.set(com.github.triplet.gradle.androidpublisher.ResolutionStrategy.IGNORE)
switch (System.env.TIER) {
switch (String.valueOf(tier)) {
case 'beta':
track.set("beta")
println "TIER set to beta"