Commit 27982170 authored by Wilko Manger's avatar Wilko Manger

Merge branch 'add-signing' into 'master'

Sign Debug and Release builds using persistent key store

See merge request !3
parents 2c4faf73 70f69468
Pipeline #228 passed with stage
in 3 minutes and 6 seconds
build:
.build:defaults: &build_defaults
stage: build
image: thyrlian/android-sdk:latest
tags:
- docker
artifacts:
paths:
- pattle.apk
expire_in: 7 days
build:debug:
<<: *build_defaults
only:
changes:
- app/**/*
- "*gradle*"
except:
variables:
- $DEBUG_STORE
- $RELEASE_STORE
script:
- ./gradlew assembleDebug --stacktrace
- mv app/build/outputs/apk/debug/app-debug.apk pattle.apk
artifacts:
paths:
- pattle.apk
expire_in: 7 days
build:debug-signed:
<<: *build_defaults
only:
changes:
- app/**/*
- "*gradle*"
refs:
- branches
variables:
- $DEBUG_STORE
script:
- echo "$DEBUG_STORE" | base64 -d > app/debug.keystore
- ./gradlew assembleDebugCi --stacktrace
- mv app/build/outputs/apk/debugCi/app-debugCi.apk pattle.apk
after_script:
- rm app/debug.keystore
build:release-signed:
<<: *build_defaults
only:
refs:
- tags
variables:
- $RELEASE_STORE
script:
- echo "$RELEASE_STORE" | base64 -d > app/release.keystore
- ./gradlew assembleReleaseCi --stacktrace
- mv app/build/outputs/apk/releaseCi/app-releaseCi.apk pattle.apk
after_script:
- rm app/release.keystore
......@@ -36,11 +36,35 @@ android {
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
}
signingConfigs {
releaseCi {
keyAlias System.getenv('RELEASE_KEY_ALIAS')
keyPassword System.getenv('RELEASE_KEY_PASSWORD')
storeFile file('release.keystore')
storePassword System.getenv('RELEASE_STORE_PASSWORD')
}
debugCi {
keyAlias System.getenv('DEBUG_KEY_ALIAS')
keyPassword System.getenv('DEBUG_KEY_PASSWORD')
storeFile file('debug.keystore')
storePassword System.getenv('DEBUG_STORE_PASSWORD')
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
}
releaseCi {
initWith release
signingConfig signingConfigs.releaseCi
}
debugCi {
initWith debug
signingConfig signingConfigs.debugCi
}
}
testOptions {
unitTests {
......@@ -57,7 +81,6 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment