Skip to content

Commit

Permalink
separate key per flavor
Browse files Browse the repository at this point in the history
  • Loading branch information
kid1412621 committed May 9, 2024
1 parent 70eb3ae commit b4ce978
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
tags:
- '*'

env:
PROD_RELEASE: true

jobs:
build_release_github:
environment: production
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Test

env:
CI_TEST: true

on:
push:
branches: [ "main" ]
Expand Down
8 changes: 4 additions & 4 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ kotlin {
jvmToolchain(17)
}

val isProdRelease = System.getenv("PROD_RELEASE")?.toBoolean() ?: false

android {
namespace = "me.nanova.subspace"
compileSdk = 34
Expand All @@ -39,7 +37,7 @@ android {
val keystoreDir = "keystore"
fun buildSignConfig(keyStoreFile: String, apkSigningConfig: ApkSigningConfig) {
val keystorePropertiesFile = rootProject.file(keyStoreFile)
if (isProdRelease) {
if (keystorePropertiesFile.exists()) {
val keystoreProperties = Properties()
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
keystoreProperties.let {
Expand Down Expand Up @@ -106,11 +104,13 @@ android {
}

androidComponents {
val isCITest = System.getenv("CI_TEST")?.toBoolean() ?: false

onVariants { variant ->
// disable google service on non-prod build
val googleTask =
tasks.findByName("process${variant.name.replaceFirstChar(Char::uppercase)}GoogleServices")
googleTask?.enabled = isProdRelease && "debug" != variant.buildType
googleTask?.enabled = !isCITest && "release" == variant.buildType
}
}

Expand Down

0 comments on commit b4ce978

Please sign in to comment.