Skip to content

Commit

Permalink
travis: sign apk releases
Browse files Browse the repository at this point in the history
  • Loading branch information
spezifisch committed Aug 30, 2016
1 parent aa374e8 commit c7e71de
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ env:
- ANDROID_API_LEVEL=24
- ANDROID_BUILD_TOOLS_VERSION=24.0.1
- ADB_INSTALL_TIMEOUT=20 # minutes (2 minutes by default)
- APK_FILE="ThreeStepsAhead-$TRAVIS_TAG-test-unsigned.apk"
- APK_FILE="ThreeStepsAhead-$TRAVIS_TAG.apk"

matrix:
- EMULATOR_API_LEVEL=19 ANDROID_ABI=armeabi-v7a RELEASE=0
Expand All @@ -38,7 +38,6 @@ android:
# Latest artifacts in local repository
- extra-android-m2repository
# Specify at least one system image
- sys-img-armeabi-v7a-google_apis-$ANDROID_API_LEVEL
- sys-img-armeabi-v7a-google_apis-$EMULATOR_API_LEVEL

before_script:
Expand All @@ -53,7 +52,7 @@ script:
- ./gradlew assembleRelease -PdisablePreDex --stacktrace

before_deploy:
- cd app/build/outputs/apk; mv app-release-unsigned.apk "$APK_FILE"; ls -la; md5sum "$APK_FILE" | tee "$APK_FILE".md5; sha1sum "$APK_FILE" | tee "$APK_FILE".sha1; cd -
- cd app/build/outputs/apk; mv app-release.apk "$APK_FILE"; ls -la; md5sum "$APK_FILE" | tee "$APK_FILE".md5; sha1sum "$APK_FILE" | tee "$APK_FILE".sha1; cd -

deploy:
provider: releases
Expand Down
13 changes: 13 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,21 @@ android {
versionCode 5
versionName "0.5"
}
signingConfigs {
if (System.getenv("TRAVIS")) {
release {
storeFile rootProject.file('release.keystore')
storePassword System.getenv("KEYSTORE_PASS")
keyAlias System.getenv("ALIAS_NAME")
keyPassword System.getenv("ALIAS_PASS")
}
}
}
buildTypes {
release {
if (System.getenv("TRAVIS")) {
signingConfig signingConfigs.release
}
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
Expand Down
Binary file added release.keystore
Binary file not shown.

0 comments on commit c7e71de

Please sign in to comment.