Skip to content

Commit e06cd8e

Browse files
committed
Configure CI
1 parent 167f639 commit e06cd8e

File tree

4 files changed

+30
-3
lines changed

4 files changed

+30
-3
lines changed

.circleci/config.yml

+5
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ jobs:
2121
paths:
2222
- ~/.gradle
2323
key: jars-{{ checksum "build.gradle.kts" }}-{{ checksum "app/build.gradle.kts" }}
24+
- run:
25+
name: Setup environment
26+
command: |
27+
gpg --passphrase "$GPG_KEY" --pinentry-mode loopback upload-keystore.jks.gpg
28+
gpg --passphrase "$GPG_KEY" --pinentry-mode loopback publish-key.json.gpg
2429
- run:
2530
name: Run tests and checks
2631
command: ./gradlew check

app/build.gradle.kts

+25-3
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@ android {
5151
"\"${localProperties.getProperty("openweather.apiKey", "")}\""
5252
)
5353
} else {
54-
buildConfigField("String", "OPEN_WEATHER_API_KEY", "\"\"")
54+
buildConfigField(
55+
"String",
56+
"OPEN_WEATHER_API_KEY",
57+
"\"${System.getenv("OPEN_WEATHER_API_KEY")}\""
58+
)
5559
}
5660

5761
buildConfigField("int", "WEATHER_FORECASTS_LIMIT", "12")
@@ -88,6 +92,18 @@ android {
8892
storePassword = keystoreProperties.getProperty("keystore.upload.password")
8993
keyAlias = keystoreProperties.getProperty("keystore.upload.key.alias")
9094
keyPassword = keystoreProperties.getProperty("keystore.upload.key.password")
95+
} else if (!System.getenv("KEYSTORE_FILE").isNullOrEmpty()) {
96+
storeFile = rootProject.file(System.getenv("KEYSTORE_FILE"))
97+
storePassword = System.getenv("KEYSTORE_PASSWORD")
98+
keyAlias = System.getenv("KEYSTORE_KEY_ALIAS")
99+
keyPassword = System.getenv("KEYSTORE_KEY_PASSWORD")
100+
} else {
101+
val debugSigningConfig = getByName("debug")
102+
103+
storeFile = debugSigningConfig.storeFile
104+
storePassword = debugSigningConfig.storePassword
105+
keyAlias = debugSigningConfig.keyAlias
106+
keyPassword = debugSigningConfig.keyPassword
91107
}
92108
}
93109
}
@@ -99,8 +115,8 @@ android {
99115
signingConfig = signingConfigs.getByName("release")
100116

101117
proguardFiles(
102-
getDefaultProguardFile("proguard-android-optimize.txt"),
103-
"proguard-rules.pro"
118+
getDefaultProguardFile("proguard-android-optimize.txt"),
119+
"proguard-rules.pro"
104120
)
105121
}
106122
}
@@ -129,6 +145,12 @@ play {
129145
releaseStatus = "inProgress"
130146
userFraction = 0.5
131147
defaultToAppBundles = true
148+
} else if (!System.getenv("PLAYSTORE_CREDENTIALS").isNullOrEmpty()) {
149+
serviceAccountCredentials = rootProject.file("PLAYSTORE_CREDENTIALS")
150+
track = "alpha"
151+
releaseStatus = "inProgress"
152+
userFraction = 0.5
153+
defaultToAppBundles = true
132154
} else {
133155
isEnabled = false
134156
}

publish-key.json.gpg

1.69 KB
Binary file not shown.

upload-keystore.jks.gpg

2.16 KB
Binary file not shown.

0 commit comments

Comments
 (0)