Skip to content

Commit

Permalink
Switch to using local debug.keystore in all samples. (#1362)
Browse files Browse the repository at this point in the history
Switching to local debug.keystore to prevent issues with installing
debug app on device.
  • Loading branch information
riggaroo committed Apr 29, 2024
2 parents ff21481 + b22b5a9 commit ac8340d
Show file tree
Hide file tree
Showing 37 changed files with 161 additions and 66 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/Crane.yaml
Expand Up @@ -15,13 +15,19 @@ on:

env:
SAMPLE_PATH: Crane

compose_store_password: ${{ secrets.compose_store_password }}
compose_key_alias: ${{ secrets.compose_key_alias }}
compose_key_password: ${{ secrets.compose_key_password }}
jobs:
build:
uses: ./.github/workflows/build-sample.yml
with:
name: Crane
path: Crane
secrets:
compose_store_password: ${{ secrets.COMPOSE_STORE_PASSWORD }}
compose_key_alias: ${{ secrets.COMPOSE_KEY_ALIAS }}
compose_key_password: ${{ secrets.COMPOSE_KEY_PASSWORD }}

test:
needs: build
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/JetLagged.yaml
Expand Up @@ -15,13 +15,19 @@ on:

env:
SAMPLE_PATH: JetLagged

compose_store_password: ${{ secrets.COMPOSE_STORE_PASSWORD }}
compose_key_alias: ${{ secrets.COMPOSE_KEY_ALIAS }}
compose_key_password: ${{ secrets.COMPOSE_KEY_PASSWORD }}
jobs:
build:
uses: ./.github/workflows/build-sample.yml
with:
name: JetLagged
path: JetLagged
secrets:
compose_store_password: ${{ secrets.COMPOSE_STORE_PASSWORD }}
compose_key_alias: ${{ secrets.COMPOSE_KEY_ALIAS }}
compose_key_password: ${{ secrets.COMPOSE_KEY_PASSWORD }}

test:
needs: build
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/JetNews.yaml
Expand Up @@ -15,13 +15,19 @@ on:

env:
SAMPLE_PATH: JetNews

compose_store_password: ${{ secrets.compose_store_password }}
compose_key_alias: ${{ secrets.compose_key_alias }}
compose_key_password: ${{ secrets.compose_key_password }}
jobs:
build:
uses: ./.github/workflows/build-sample.yml
with:
name: JetNews
path: JetNews
secrets:
compose_store_password: ${{ secrets.COMPOSE_STORE_PASSWORD }}
compose_key_alias: ${{ secrets.COMPOSE_KEY_ALIAS }}
compose_key_password: ${{ secrets.COMPOSE_KEY_PASSWORD }}

androidTest:
needs: build
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/Jetcaster.yaml
Expand Up @@ -20,3 +20,7 @@ jobs:
name: Jetcaster
path: Jetcaster
module: mobile
secrets:
compose_store_password: ${{ secrets.COMPOSE_STORE_PASSWORD }}
compose_key_alias: ${{ secrets.COMPOSE_KEY_ALIAS }}
compose_key_password: ${{ secrets.COMPOSE_KEY_PASSWORD }}
9 changes: 7 additions & 2 deletions .github/workflows/Jetchat.yaml
Expand Up @@ -15,14 +15,19 @@ on:

env:
SAMPLE_PATH: Jetchat

compose_store_password: ${{ secrets.compose_store_password }}
compose_key_alias: ${{ secrets.compose_key_alias }}
compose_key_password: ${{ secrets.compose_key_password }}
jobs:
build:
uses: ./.github/workflows/build-sample.yml
with:
name: Jetchat
path: Jetchat

secrets:
compose_store_password: ${{ secrets.COMPOSE_STORE_PASSWORD }}
compose_key_alias: ${{ secrets.COMPOSE_KEY_ALIAS }}
compose_key_password: ${{ secrets.COMPOSE_KEY_PASSWORD }}
test:
needs: build
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/Jetsnack.yaml
Expand Up @@ -19,3 +19,7 @@ jobs:
with:
name: Jetsnack
path: Jetsnack
secrets:
compose_store_password: ${{ secrets.COMPOSE_STORE_PASSWORD }}
compose_key_alias: ${{ secrets.COMPOSE_KEY_ALIAS }}
compose_key_password: ${{ secrets.COMPOSE_KEY_PASSWORD }}
4 changes: 4 additions & 0 deletions .github/workflows/Jetsurvey.yaml
Expand Up @@ -19,3 +19,7 @@ jobs:
with:
name: Jetsurvey
path: Jetsurvey
secrets:
compose_store_password: ${{ secrets.COMPOSE_STORE_PASSWORD }}
compose_key_alias: ${{ secrets.COMPOSE_KEY_ALIAS }}
compose_key_password: ${{ secrets.COMPOSE_KEY_PASSWORD }}
8 changes: 7 additions & 1 deletion .github/workflows/Owl.yaml
Expand Up @@ -15,13 +15,19 @@ on:

env:
SAMPLE_PATH: Owl

compose_store_password: ${{ secrets.COMPOSE_STORE_PASSWORD }}
compose_key_alias: ${{ secrets.COMPOSE_KEY_ALIAS }}
compose_key_password: ${{ secrets.COMPOSE_KEY_PASSWORD }}
jobs:
build:
uses: ./.github/workflows/build-sample.yml
with:
name: Owl
path: Owl
secrets:
compose_store_password: ${{ secrets.COMPOSE_STORE_PASSWORD }}
compose_key_alias: ${{ secrets.COMPOSE_KEY_ALIAS }}
compose_key_password: ${{ secrets.COMPOSE_KEY_PASSWORD }}

test:
needs: build
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/Release.yml
Expand Up @@ -4,7 +4,10 @@ on:
push:
tags:
- 'v*'

env:
compose_store_password: ${{ secrets.COMPOSE_STORE_PASSWORD }}
compose_key_alias: ${{ secrets.COMPOSE_KEY_ALIAS }}
compose_key_password: ${{ secrets.COMPOSE_KEY_PASSWORD }}
jobs:
build:
runs-on: ubuntu-latest
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/Reply.yaml
Expand Up @@ -15,17 +15,23 @@ on:

env:
SAMPLE_PATH: Reply

compose_store_password: ${{ secrets.COMPOSE_STORE_PASSWORD }}
compose_key_alias: ${{ secrets.COMPOSE_KEY_ALIAS }}
compose_key_password: ${{ secrets.COMPOSE_KEY_PASSWORD }}
jobs:
build:
uses: ./.github/workflows/build-sample.yml
with:
name: Reply
path: Reply
secrets:
compose_store_password: ${{ secrets.COMPOSE_STORE_PASSWORD }}
compose_key_alias: ${{ secrets.COMPOSE_KEY_ALIAS }}
compose_key_password: ${{ secrets.COMPOSE_KEY_PASSWORD }}

test:
needs: build
runs-on: ubuntu-latest
runs-on: ubuntu-latest # enables hardware acceleration in the virtual machine
timeout-minutes: 30
strategy:
matrix:
Expand Down
20 changes: 16 additions & 4 deletions .github/workflows/build-sample.yml
Expand Up @@ -12,11 +12,23 @@ on:
module:
default: "app"
type: string

secrets:
compose_store_password:
description: 'password for the keystore'
required: true
compose_key_alias:
description: 'alias for the keystore'
required: true
compose_key_password:
description: 'password for the key'
required: true
concurrency:
group: ${{ inputs.name }}-build-${{ github.ref }}
cancel-in-progress: true

env:
compose_store_password: ${{ secrets.compose_store_password }}
compose_key_alias: ${{ secrets.compose_key_alias }}
compose_key_password: ${{ secrets.compose_key_password }}
jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -69,11 +81,11 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: build-outputs
path: ${{ inputs.path }}/${{ inputs.module }}/build/outputs
path: ${{ inputs.path }}/app/build/outputs

- name: Upload build reports
if: always()
uses: actions/upload-artifact@v4
with:
name: build-reports
path: ${{ inputs.path }}/${{ inputs.module }}/build/reports
path: ${{ inputs.path }}/app/build/reports
5 changes: 4 additions & 1 deletion .github/workflows/test-snapshot.yml
Expand Up @@ -9,7 +9,10 @@ on:
composeVersion:
required: true
type: string

env:
compose_store_password: ${{ secrets.COMPOSE_STORE_PASSWORD }}
compose_key_alias: $${{ secrets.COMPOSE_KEY_ALIAS }}
compose_key_password: $${{ secrets.COMPOSE_KEY_PASSWORD }}
concurrency:
group: ${{ inputs.name }}-build-${{ github.ref }}
cancel-in-progress: true
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/update_deps.yml
Expand Up @@ -2,7 +2,10 @@ name: Update Versions / Dependencies

on:
workflow_dispatch:

env:
compose_store_password: ${{ secrets.COMPOSE_STORE_PASSWORD }}
compose_key_alias: ${{ secrets.COMPOSE_KEY_ALIAS }}
compose_key_password: ${{ secrets.COMPOSE_KEY_PASSWORD }}
jobs:
build:
runs-on: ubuntu-latest
Expand Down
13 changes: 7 additions & 6 deletions Crane/app/build.gradle.kts
Expand Up @@ -45,18 +45,19 @@ 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 = rootProject.file("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 = signingConfigs.getByName("debug")
}

getByName("release") {
Expand Down
Binary file removed Crane/debug.keystore
Binary file not shown.
Binary file added Crane/debug_2.keystore
Binary file not shown.
15 changes: 9 additions & 6 deletions JetLagged/app/build.gradle.kts
Expand Up @@ -34,18 +34,21 @@ android {
}

signingConfigs {
// We use a bundled debug keystore, to allow debug builds from CI to be upgradable
// 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 = rootProject.file("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 = signingConfigs.getByName("debug")

}

getByName("release") {
Expand Down
Binary file removed JetLagged/debug.keystore
Binary file not shown.
Binary file added JetLagged/debug_2.keystore
Binary file not shown.
15 changes: 9 additions & 6 deletions JetNews/app/build.gradle.kts
Expand Up @@ -34,18 +34,21 @@ android {
}

signingConfigs {
// We use a bundled debug keystore, to allow debug builds from CI to be upgradable
// 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 = rootProject.file("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 = signingConfigs.getByName("debug")

}

getByName("release") {
Expand Down
Binary file removed JetNews/debug.keystore
Binary file not shown.
Binary file added JetNews/debug_2.keystore
Binary file not shown.
Binary file removed Jetcaster/debug.keystore
Binary file not shown.
Binary file added Jetcaster/debug_2.keystore
Binary file not shown.
23 changes: 15 additions & 8 deletions Jetcaster/mobile/build.gradle.kts
Expand Up @@ -21,6 +21,7 @@ plugins {
alias(libs.plugins.hilt)
}


android {
compileSdk = libs.versions.compileSdk.get().toInt()
namespace = "com.example.jetcaster"
Expand All @@ -35,25 +36,31 @@ android {
}

signingConfigs {
// We use a bundled debug keystore, to allow debug builds from CI to be upgradable
// 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 = rootProject.file("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"
)
}
}

Expand Down
15 changes: 9 additions & 6 deletions Jetchat/app/build.gradle.kts
Expand Up @@ -35,18 +35,21 @@ android {
}

signingConfigs {
// We use a bundled debug keystore, to allow debug builds from CI to be upgradable
// 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 = rootProject.file("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 = signingConfigs.getByName("debug")

}

getByName("release") {
Expand Down
Binary file removed Jetchat/debug.keystore
Binary file not shown.
Binary file added Jetchat/debug_2.keystore
Binary file not shown.

0 comments on commit ac8340d

Please sign in to comment.