diff --git a/.github/workflows/build-sample.yml b/.github/workflows/build-sample.yml index b1e03607b6..ff478d037d 100644 --- a/.github/workflows/build-sample.yml +++ b/.github/workflows/build-sample.yml @@ -57,6 +57,10 @@ jobs: - name: Build release working-directory: ${{ inputs.path }} run: ./gradlew assembleRelease --stacktrace + env: + compose_store_password: ${{secrets.compose_store_password}} + compose_key_alias: $${{secrets.compose_key_alias}} + compose_key_password: $${{secrets.compose_key_password}} - name: Run local tests working-directory: ${{ inputs.path }} diff --git a/Crane/app/build.gradle.kts b/Crane/app/build.gradle.kts index ff12a79b33..6ea2a52d50 100644 --- a/Crane/app/build.gradle.kts +++ b/Crane/app/build.gradle.kts @@ -45,12 +45,14 @@ android { } signingConfigs { - // We use a bundled debug keystore, to allow debug builds from CI to be upgradable + val userKeystore = File(System.getProperty("user.home"), ".android/debug.keystore") + val localKeystore = rootProject.file("debug_2.keystore") + val hasKeyInfo = userKeystore.exists() named("debug") { - storeFile = File(System.getProperty("user.home"), ".android/debug.keystore") - storePassword = "android" - keyAlias = "androiddebugkey" - keyPassword = "android" + storeFile = if (hasKeyInfo) userKeystore else localKeystore + storePassword = if (hasKeyInfo) "android" else System.getenv("compose_store_password") + keyAlias = if (hasKeyInfo) "androiddebugkey" else System.getenv("compose_key_alias") + keyPassword = if (hasKeyInfo) "android" else System.getenv("compose_key_password") } } diff --git a/Crane/debug_2.keystore b/Crane/debug_2.keystore new file mode 100644 index 0000000000..b42c971788 Binary files /dev/null and b/Crane/debug_2.keystore differ diff --git a/JetLagged/app/build.gradle.kts b/JetLagged/app/build.gradle.kts index d452f05e01..61bb5a3790 100644 --- a/JetLagged/app/build.gradle.kts +++ b/JetLagged/app/build.gradle.kts @@ -35,11 +35,14 @@ android { signingConfigs { // Important: change the keystore for a production deployment + val userKeystore = File(System.getProperty("user.home"), ".android/debug.keystore") + val localKeystore = rootProject.file("debug_2.keystore") + val hasKeyInfo = userKeystore.exists() named("debug") { - storeFile = File(System.getProperty("user.home"), ".android/debug.keystore") - storePassword = "android" - keyAlias = "androiddebugkey" - keyPassword = "android" + storeFile = if (hasKeyInfo) userKeystore else localKeystore + storePassword = if (hasKeyInfo) "android" else System.getenv("compose_store_password") + keyAlias = if (hasKeyInfo) "androiddebugkey" else System.getenv("compose_key_alias") + keyPassword = if (hasKeyInfo) "android" else System.getenv("compose_key_password") } } diff --git a/JetLagged/debug_2.keystore b/JetLagged/debug_2.keystore new file mode 100644 index 0000000000..b42c971788 Binary files /dev/null and b/JetLagged/debug_2.keystore differ diff --git a/JetNews/app/build.gradle.kts b/JetNews/app/build.gradle.kts index 1b89cd7df0..0d807bfa31 100644 --- a/JetNews/app/build.gradle.kts +++ b/JetNews/app/build.gradle.kts @@ -35,11 +35,14 @@ android { signingConfigs { // Important: change the keystore for a production deployment + val userKeystore = File(System.getProperty("user.home"), ".android/debug.keystore") + val localKeystore = rootProject.file("debug_2.keystore") + val hasKeyInfo = userKeystore.exists() named("debug") { - storeFile = File(System.getProperty("user.home"), ".android/debug.keystore") - storePassword = "android" - keyAlias = "androiddebugkey" - keyPassword = "android" + storeFile = if (hasKeyInfo) userKeystore else localKeystore + storePassword = if (hasKeyInfo) "android" else System.getenv("compose_store_password") + keyAlias = if (hasKeyInfo) "androiddebugkey" else System.getenv("compose_key_alias") + keyPassword = if (hasKeyInfo) "android" else System.getenv("compose_key_password") } } diff --git a/JetNews/debug_2.keystore b/JetNews/debug_2.keystore new file mode 100644 index 0000000000..b42c971788 Binary files /dev/null and b/JetNews/debug_2.keystore differ diff --git a/Jetcaster/app/build.gradle.kts b/Jetcaster/app/build.gradle.kts index 10b03b691c..47cfafd312 100644 --- a/Jetcaster/app/build.gradle.kts +++ b/Jetcaster/app/build.gradle.kts @@ -21,6 +21,7 @@ plugins { alias(libs.plugins.hilt) } + android { compileSdk = libs.versions.compileSdk.get().toInt() namespace = "com.example.jetcaster" @@ -36,24 +37,30 @@ android { signingConfigs { // Important: change the keystore for a production deployment + val userKeystore = File(System.getProperty("user.home"), ".android/debug.keystore") + val localKeystore = rootProject.file("debug_2.keystore") + val hasKeyInfo = userKeystore.exists() named("debug") { - storeFile = File(System.getProperty("user.home"), ".android/debug.keystore") - storePassword = "android" - keyAlias = "androiddebugkey" - keyPassword = "android" + // get from env variables + storeFile = if (hasKeyInfo) userKeystore else localKeystore + storePassword = if (hasKeyInfo) "android" else System.getenv("compose_store_password") + keyAlias = if (hasKeyInfo) "androiddebugkey" else System.getenv("compose_key_alias") + keyPassword = if (hasKeyInfo) "android" else System.getenv("compose_key_password") } } buildTypes { getByName("debug") { - signingConfig = signingConfigs.getByName("debug") + } getByName("release") { isMinifyEnabled = true signingConfig = signingConfigs.getByName("debug") - proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), - "proguard-rules.pro") + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) } } diff --git a/Jetcaster/debug_2.keystore b/Jetcaster/debug_2.keystore new file mode 100644 index 0000000000..b42c971788 Binary files /dev/null and b/Jetcaster/debug_2.keystore differ diff --git a/Jetchat/app/build.gradle.kts b/Jetchat/app/build.gradle.kts index a618fa4944..4a6e47bae0 100644 --- a/Jetchat/app/build.gradle.kts +++ b/Jetchat/app/build.gradle.kts @@ -36,11 +36,14 @@ android { signingConfigs { // Important: change the keystore for a production deployment + val userKeystore = File(System.getProperty("user.home"), ".android/debug.keystore") + val localKeystore = rootProject.file("debug_2.keystore") + val hasKeyInfo = userKeystore.exists() named("debug") { - storeFile = File(System.getProperty("user.home"), ".android/debug.keystore") - storePassword = "android" - keyAlias = "androiddebugkey" - keyPassword = "android" + storeFile = if (hasKeyInfo) userKeystore else localKeystore + storePassword = if (hasKeyInfo) "android" else System.getenv("compose_store_password") + keyAlias = if (hasKeyInfo) "androiddebugkey" else System.getenv("compose_key_alias") + keyPassword = if (hasKeyInfo) "android" else System.getenv("compose_key_password") } } diff --git a/Jetchat/debug_2.keystore b/Jetchat/debug_2.keystore new file mode 100644 index 0000000000..b42c971788 Binary files /dev/null and b/Jetchat/debug_2.keystore differ diff --git a/Jetsnack/app/build.gradle.kts b/Jetsnack/app/build.gradle.kts index 0be3cbbbff..cc174a86ce 100644 --- a/Jetsnack/app/build.gradle.kts +++ b/Jetsnack/app/build.gradle.kts @@ -35,16 +35,20 @@ android { signingConfigs { // Important: change the keystore for a production deployment + val userKeystore = File(System.getProperty("user.home"), ".android/debug.keystore") + val localKeystore = rootProject.file("debug_2.keystore") + val hasKeyInfo = userKeystore.exists() named("debug") { - storeFile = File(System.getProperty("user.home"), ".android/debug.keystore") - storePassword = "android" - keyAlias = "androiddebugkey" - keyPassword = "android" + storeFile = if (hasKeyInfo) userKeystore else localKeystore + storePassword = if (hasKeyInfo) "android" else System.getenv("compose_store_password") + keyAlias = if (hasKeyInfo) "androiddebugkey" else System.getenv("compose_key_alias") + keyPassword = if (hasKeyInfo) "android" else System.getenv("compose_key_password") } } buildTypes { getByName("debug") { + signingConfig = null signingConfig = signingConfigs.getByName("debug") } @@ -57,7 +61,7 @@ android { create("benchmark") { initWith(getByName("release")) - signingConfig = signingConfigs.getByName("debug") + // signingConfig = signingConfigs.getByName("debug") matchingFallbacks.add("release") proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-benchmark-rules.pro") diff --git a/Jetsnack/debug_2.keystore b/Jetsnack/debug_2.keystore new file mode 100644 index 0000000000..b42c971788 Binary files /dev/null and b/Jetsnack/debug_2.keystore differ diff --git a/Owl/app/build.gradle.kts b/Owl/app/build.gradle.kts index 8119b65657..a231314cb7 100644 --- a/Owl/app/build.gradle.kts +++ b/Owl/app/build.gradle.kts @@ -35,11 +35,14 @@ android { signingConfigs { // Important: change the keystore for a production deployment + val userKeystore = File(System.getProperty("user.home"), ".android/debug.keystore") + val localKeystore = rootProject.file("debug_2.keystore") + val hasKeyInfo = userKeystore.exists() named("debug") { - storeFile = File(System.getProperty("user.home"), ".android/debug.keystore") - storePassword = "android" - keyAlias = "androiddebugkey" - keyPassword = "android" + storeFile = if (hasKeyInfo) userKeystore else localKeystore + storePassword = if (hasKeyInfo) "android" else System.getenv("compose_store_password") + keyAlias = if (hasKeyInfo) "androiddebugkey" else System.getenv("compose_key_alias") + keyPassword = if (hasKeyInfo) "android" else System.getenv("compose_key_password") } } diff --git a/Owl/debug_2.keystore b/Owl/debug_2.keystore new file mode 100644 index 0000000000..b42c971788 Binary files /dev/null and b/Owl/debug_2.keystore differ diff --git a/Reply/app/build.gradle.kts b/Reply/app/build.gradle.kts index 178c2d6073..7dd74035d2 100644 --- a/Reply/app/build.gradle.kts +++ b/Reply/app/build.gradle.kts @@ -35,11 +35,15 @@ android { signingConfigs { // Important: change the keystore for a production deployment + val userKeystore = File(System.getProperty("user.home"), ".android/debug.keystore") + val localKeystore = rootProject.file("debug_2.keystore") + val hasKeyInfo = userKeystore.exists() named("debug") { - storeFile = File(System.getProperty("user.home"), ".android/debug.keystore") - storePassword = "android" - keyAlias = "androiddebugkey" - keyPassword = "android" + // get from env variables + storeFile = if (hasKeyInfo) userKeystore else localKeystore + storePassword = if (hasKeyInfo) "android" else System.getenv("compose_store_password") + keyAlias = if (hasKeyInfo) "androiddebugkey" else System.getenv("compose_key_alias") + keyPassword = if (hasKeyInfo) "android" else System.getenv("compose_key_password") } } diff --git a/Reply/debug_2.keystore b/Reply/debug_2.keystore new file mode 100644 index 0000000000..b42c971788 Binary files /dev/null and b/Reply/debug_2.keystore differ