Skip to content

Commit cb95f99

Browse files
atm1504iamareebjamal
authored andcommitted
chore: Fix the release script (#2325)
* chore: Fix the release script * chore: Remove eexport command * chore: Updated suggested changes * fix: Fix circleci build
1 parent aec002e commit cb95f99

File tree

3 files changed

+33
-4
lines changed

3 files changed

+33
-4
lines changed

app/build.gradle

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
plugins {
22
id "com.diffplug.gradle.spotless" version "3.23.1"
3+
id "com.github.b3er.local.properties" version "1.1"
34
}
45

56
def rootConfiguration = {}
@@ -15,6 +16,8 @@ def YOUTUBE_API_KEY = System.getenv('YOUTUBE_API_KEY') ?: "YOUR_API_KEY"
1516
//noinspection SpellCheckingInspection
1617
def MAPBOX_API_KEY = '"'+System.getenv('MAPBOX_API_KEY')+'"' ?: '"DEFAULT"'
1718

19+
def LOCAL_KEY_PRESENT = project.hasProperty('SIGNING_KEY_FILE') && rootProject.file(SIGNING_KEY_FILE).exists()
20+
1821
android {
1922
compileSdkVersion rootConfiguration.compileSdkVersion
2023

@@ -35,12 +38,34 @@ android {
3538
sourceCompatibility JavaVersion.VERSION_1_8
3639
targetCompatibility JavaVersion.VERSION_1_8
3740
}
41+
42+
signingConfigs {
43+
if (CIRCLE_BUILD) {
44+
release {
45+
storeFile KEYSTORE_FILE
46+
storePassword System.getenv("STORE_PASS")
47+
keyAlias System.getenv("ALIAS")
48+
keyPassword System.getenv("KEY_PASS")
49+
}
50+
} else if (LOCAL_KEY_PRESENT) {
51+
release {
52+
storeFile rootProject.file(SIGNING_KEY_FILE)
53+
storePassword STORE_PASS
54+
keyAlias ALIAS
55+
keyPassword KEY_PASS
56+
}
57+
}
58+
}
59+
3860
buildTypes {
3961
release {
4062
minifyEnabled false
4163
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
4264
buildConfigField "String", "SPEAKER_BASE_URL", '"http://10.0.0.1:5000"'
4365
buildConfigField "String", "MAPBOX_API_KEY", MAPBOX_API_KEY
66+
67+
if (LOCAL_KEY_PRESENT || CIRCLE_BUILD)
68+
signingConfig signingConfigs.release
4469
}
4570

4671
debug {

build.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,9 @@ allprojects {
2121
repositories {
2222
google()
2323
}
24-
}
2524

25+
ext {
26+
KEYSTORE_FILE = rootProject.file('scripts/key.jks')
27+
CIRCLE_BUILD = System.getenv("CIRCLECI") == "true" && KEYSTORE_FILE.exists()
28+
}
29+
}

circle.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ jobs:
2626
- run:
2727
name: spotless check
2828
command: ./gradlew spotlessCheck
29-
- run:
30-
name: Run Tests
31-
command: ./gradlew build
3229
- run:
3330
command:
3431
bash exec/prep-key.sh
32+
- run:
33+
name: Run Tests
34+
command: ./gradlew build
3535
- run:
3636
command:
3737
bash exec/apk-gen.sh

0 commit comments

Comments
 (0)