Skip to content

Commit

Permalink
1. bump firebase deps;
Browse files Browse the repository at this point in the history
2. skip google-services.json and keystore.properties for local dev and CI test.
  • Loading branch information
kid1412621 committed May 7, 2024
1 parent e80b2e1 commit 5a60267
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 67 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
tags:
- '*'

env:
PROD_RELEASE_CI: true

jobs:
build_release_github:
environment: production
Expand Down
20 changes: 0 additions & 20 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,5 @@ jobs:
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Generate fake google-services.json
run: |
cat << EOF > app/google-services.json
{
"project_info": {
"project_number": "0",
"project_id": "id",
"storage_bucket": "bucket"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "app-id",
"android_client_info": { "package_name": "me.nanova.subspace" }
},
"api_key": [{"current_key": "key"}]
}
]
}
EOF
- name: Run unit tests
run: ./gradlew test --no-daemon
36 changes: 0 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1 @@
[![Test](https://github.com/kid1412621/subspace/actions/workflows/test.yml/badge.svg)](https://github.com/kid1412621/subspace/actions/workflows/test.yml)

# Project setup

1. Add a dummy google-services.json to app directory:

```bash
cat << EOF > app/google-services.json
{
"project_info": {
"project_number": "0",
"project_id": "id",
"storage_bucket": "bucket"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "app-id",
"android_client_info": { "package_name": "me.nanova.subspace" }
},
"api_key": [{"current_key": "key"}]
}
]
}
EOF
```

2. Add a dummy keystore.properties to project root directory:

```bash
cat << EOF > keystore.properties
storeFile:keystore.jks
storePassword:fake-password
keyAlias:fake-key-alias
keyPassword:fake-password
EOF
```
20 changes: 9 additions & 11 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,12 @@ android {
}
}

val isProdReleaseCI = System.getenv("PROD_RELEASE_CI")?.toBoolean() ?: false

signingConfigs {
fun buildSignKey(
propertiesFile: String,
apkSigningConfig: ApkSigningConfig
) {
val keystorePropertiesFile = rootProject.file(propertiesFile)
// skip for test
if (keystorePropertiesFile.exists()) {
fun buildSignConfig(apkSigningConfig: ApkSigningConfig) {
val keystorePropertiesFile = rootProject.file("keystore.properties")
if (isProdReleaseCI) {
val keystoreProperties = Properties()
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
keystoreProperties.let {
Expand All @@ -52,10 +50,10 @@ android {
}
}
create("githubReleaseKey") {
buildSignKey("keystore.properties", this)
buildSignConfig(this)
}
create("playUploadKey") {
buildSignKey("keystore.properties", this)
buildSignConfig(this)
}
}

Expand Down Expand Up @@ -91,7 +89,7 @@ android {
onVariants { variant ->
val googleTask =
tasks.findByName("process${variant.name.replaceFirstChar(Char::uppercase)}GoogleServices")
googleTask?.enabled = "debug" != variant.buildType
googleTask?.enabled = isProdReleaseCI && "debug" != variant.buildType
}
}

Expand Down Expand Up @@ -171,7 +169,7 @@ dependencies {
implementation("com.squareup.okhttp3:logging-interceptor:4.12.0")

// firebase
implementation(platform("com.google.firebase:firebase-bom:32.8.1"))
implementation(platform("com.google.firebase:firebase-bom:33.0.0"))
implementation("com.google.firebase:firebase-crashlytics")
implementation("com.google.firebase:firebase-analytics")

Expand Down

0 comments on commit 5a60267

Please sign in to comment.