Skip to content

Commit

Permalink
chore: Fix the release script (#2325)
Browse files Browse the repository at this point in the history
* chore: Fix the release script

* chore: Remove eexport command

* chore: Updated suggested changes

* fix: Fix circleci build
  • Loading branch information
atm1504 authored and iamareebjamal committed Jul 27, 2019
1 parent aec002e commit cb95f99
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 4 deletions.
25 changes: 25 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id "com.diffplug.gradle.spotless" version "3.23.1"
id "com.github.b3er.local.properties" version "1.1"
}

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

def LOCAL_KEY_PRESENT = project.hasProperty('SIGNING_KEY_FILE') && rootProject.file(SIGNING_KEY_FILE).exists()

android {
compileSdkVersion rootConfiguration.compileSdkVersion

Expand All @@ -35,12 +38,34 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

signingConfigs {
if (CIRCLE_BUILD) {
release {
storeFile KEYSTORE_FILE
storePassword System.getenv("STORE_PASS")
keyAlias System.getenv("ALIAS")
keyPassword System.getenv("KEY_PASS")
}
} else if (LOCAL_KEY_PRESENT) {
release {
storeFile rootProject.file(SIGNING_KEY_FILE)
storePassword STORE_PASS
keyAlias ALIAS
keyPassword KEY_PASS
}
}
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
buildConfigField "String", "SPEAKER_BASE_URL", '"http://10.0.0.1:5000"'
buildConfigField "String", "MAPBOX_API_KEY", MAPBOX_API_KEY

if (LOCAL_KEY_PRESENT || CIRCLE_BUILD)
signingConfig signingConfigs.release
}

debug {
Expand Down
6 changes: 5 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,9 @@ allprojects {
repositories {
google()
}
}

ext {
KEYSTORE_FILE = rootProject.file('scripts/key.jks')
CIRCLE_BUILD = System.getenv("CIRCLECI") == "true" && KEYSTORE_FILE.exists()
}
}
6 changes: 3 additions & 3 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ jobs:
- run:
name: spotless check
command: ./gradlew spotlessCheck
- run:
name: Run Tests
command: ./gradlew build
- run:
command:
bash exec/prep-key.sh
- run:
name: Run Tests
command: ./gradlew build
- run:
command:
bash exec/apk-gen.sh
Expand Down

0 comments on commit cb95f99

Please sign in to comment.