Skip to content

Commit

Permalink
Remove building release on PRs (#1380)
Browse files Browse the repository at this point in the history
When building from a fork pull request, the secrets are not shared. This
PR removes the need to build a release since it wasn't used, named the
signing config it to be a release.
  • Loading branch information
riggaroo authored May 1, 2024
2 parents cf40662 + b704c2d commit 1ad734f
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Crane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
target: google_apis
arch: x86
disable-animations: true
script: ./gradlew connectedCheck --stacktrace
script: ./gradlew app:connectedDebugAndroidTest --stacktrace
working-directory: ${{ env.SAMPLE_PATH }}

- name: Upload test reports
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/build-sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@ jobs:
working-directory: ${{ inputs.path }}
run: ./gradlew assembleDebug --stacktrace

- name: Build release
working-directory: ${{ inputs.path }}
run: ./gradlew assembleRelease --stacktrace

- name: Run local tests
working-directory: ${{ inputs.path }}
run: ./gradlew testDebug --stacktrace
Expand Down
7 changes: 4 additions & 3 deletions Crane/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ android {
val userKeystore = File(System.getProperty("user.home"), ".android/debug.keystore")
val localKeystore = rootProject.file("debug_2.keystore")
val hasKeyInfo = userKeystore.exists()
named("debug") {
create("release") {
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")
Expand All @@ -58,18 +58,19 @@ android {

buildTypes {
getByName("debug") {

}

getByName("release") {
isMinifyEnabled = true
signingConfig = signingConfigs.getByName("debug")
signingConfig = signingConfigs.getByName("release")
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro")
}

create("benchmark") {
initWith(getByName("release"))
signingConfig = signingConfigs.getByName("debug")
signingConfig = signingConfigs.getByName("release")
matchingFallbacks.add("release")
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-benchmark-rules.pro")
Expand Down
6 changes: 3 additions & 3 deletions JetLagged/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ android {
val userKeystore = File(System.getProperty("user.home"), ".android/debug.keystore")
val localKeystore = rootProject.file("debug_2.keystore")
val hasKeyInfo = userKeystore.exists()
named("debug") {
create("release") {
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")
Expand All @@ -53,14 +53,14 @@ android {

getByName("release") {
isMinifyEnabled = true
signingConfig = signingConfigs.getByName("debug")
signingConfig = signingConfigs.getByName("release")
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro")
}

create("benchmark") {
initWith(getByName("release"))
signingConfig = signingConfigs.getByName("debug")
signingConfig = signingConfigs.getByName("release")
matchingFallbacks.add("release")
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-benchmark-rules.pro")
Expand Down
4 changes: 2 additions & 2 deletions JetNews/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ android {
val userKeystore = File(System.getProperty("user.home"), ".android/debug.keystore")
val localKeystore = rootProject.file("debug_2.keystore")
val hasKeyInfo = userKeystore.exists()
named("debug") {
create("release") {
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")
Expand All @@ -53,7 +53,7 @@ android {

getByName("release") {
isMinifyEnabled = true
signingConfig = signingConfigs.getByName("debug")
signingConfig = signingConfigs.getByName("release")
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro")
}
Expand Down
4 changes: 2 additions & 2 deletions Jetcaster/mobile/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ android {
val userKeystore = File(System.getProperty("user.home"), ".android/debug.keystore")
val localKeystore = rootProject.file("debug_2.keystore")
val hasKeyInfo = userKeystore.exists()
named("debug") {
create("release") {
// get from env variables
storeFile = if (hasKeyInfo) userKeystore else localKeystore
storePassword = if (hasKeyInfo) "android" else System.getenv("compose_store_password")
Expand All @@ -56,7 +56,7 @@ android {

getByName("release") {
isMinifyEnabled = true
signingConfig = signingConfigs.getByName("debug")
signingConfig = signingConfigs.getByName("release")
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
Expand Down
6 changes: 3 additions & 3 deletions Jetchat/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ android {
val userKeystore = File(System.getProperty("user.home"), ".android/debug.keystore")
val localKeystore = rootProject.file("debug_2.keystore")
val hasKeyInfo = userKeystore.exists()
named("debug") {
create("release") {
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")
Expand All @@ -49,12 +49,12 @@ android {

buildTypes {
getByName("debug") {

}

getByName("release") {
isMinifyEnabled = true
signingConfig = signingConfigs.getByName("debug")
signingConfig = signingConfigs.getByName("release")
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro")
}
Expand Down
6 changes: 3 additions & 3 deletions Jetsnack/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ android {
val userKeystore = File(System.getProperty("user.home"), ".android/debug.keystore")
val localKeystore = rootProject.file("debug_2.keystore")
val hasKeyInfo = userKeystore.exists()
named("debug") {
create("release") {
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")
Expand All @@ -53,14 +53,14 @@ android {

getByName("release") {
isMinifyEnabled = true
signingConfig = signingConfigs.getByName("debug")
signingConfig = signingConfigs.getByName("release")
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro")
}

create("benchmark") {
initWith(getByName("release"))
// signingConfig = signingConfigs.getByName("debug")
signingConfig = signingConfigs.getByName("release")
matchingFallbacks.add("release")
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-benchmark-rules.pro")
Expand Down
4 changes: 2 additions & 2 deletions Owl/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ android {
val userKeystore = File(System.getProperty("user.home"), ".android/debug.keystore")
val localKeystore = rootProject.file("debug_2.keystore")
val hasKeyInfo = userKeystore.exists()
named("debug") {
create("release") {
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")
Expand All @@ -53,7 +53,7 @@ android {

getByName("release") {
isMinifyEnabled = true
signingConfig = signingConfigs.getByName("debug")
signingConfig = signingConfigs.getByName("release")
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro")
}
Expand Down
4 changes: 2 additions & 2 deletions Reply/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ android {
val userKeystore = File(System.getProperty("user.home"), ".android/debug.keystore")
val localKeystore = rootProject.file("debug_2.keystore")
val hasKeyInfo = userKeystore.exists()
named("debug") {
create("release") {
// get from env variables
storeFile = if (hasKeyInfo) userKeystore else localKeystore
storePassword = if (hasKeyInfo) "android" else System.getenv("compose_store_password")
Expand All @@ -54,7 +54,7 @@ android {

getByName("release") {
isMinifyEnabled = true
signingConfig = signingConfigs.getByName("debug")
signingConfig = signingConfigs.getByName("release")
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro")
}
Expand Down

0 comments on commit 1ad734f

Please sign in to comment.