Skip to content

Commit

Permalink
[WIP] Sign lottie artifacts (#877)
Browse files Browse the repository at this point in the history
  • Loading branch information
gpeal committed Aug 8, 2018
1 parent f675a55 commit 1718548
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 10 deletions.
9 changes: 4 additions & 5 deletions .travis.yml
Expand Up @@ -18,7 +18,8 @@ env:
- PATH=${HOME}/google-cloud-sdk/bin:$PATH CLOUDSDK_CORE_DISABLE_PROMPTS=1
before_install:
- openssl aes-256-cbc -K $encrypted_7f6a0d70974a_key -iv $encrypted_7f6a0d70974a_iv
-in lottie-upload-key.jks.enc -out lottie-upload-key.jks -d
-in secrets.tar.enc -out secrets.tar -d
- tar xvf secrets.tar
- export TRAVIS_GIT_BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH;
else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
- export GIT_SHA=$(git rev-parse HEAD)
Expand Down Expand Up @@ -63,12 +64,10 @@ jobs:
- stage: deploy
name: Create release and upload artifacts
script:
- ./gradlew :LottieSample:assembleRelease
- ./sign.sh
- ./gradlew -PNEXUS_USERNAME=$NEXUS_USERNAME -PNEXUS_PASSWORD=$NEXUS_PASSWORD :lottie:uploadArchives
- "./sign.sh"
deploy:
provider: releases
api_key: $GITHUB_ACCESS_TOKEN
api_key: "$GITHUB_ACCESS_TOKEN"
file: LottieSample/build/outputs/apk/release/LottieSample-release-aligned.apk
skip_cleanup: true
on:
Expand Down
4 changes: 2 additions & 2 deletions LottieSample/build.gradle
Expand Up @@ -12,8 +12,8 @@ android {
applicationId "com.airbnb.lottie"
minSdkVersion 16
targetSdkVersion 27
versionCode 56
versionName "2.6.0-beta15"
versionCode 59
versionName "2.6.0-signed3"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Expand Up @@ -17,7 +17,7 @@
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

VERSION_NAME=2.6.0-beta15
VERSION_NAME=2.6.0-signed3
GROUP=com.airbnb.android

POM_DESCRIPTION=Lottie is an animation library that renders Adobe After Effects animations natively in realtime.
Expand Down
Binary file removed lottie-upload-key.jks.enc
Binary file not shown.
12 changes: 10 additions & 2 deletions lottie/build.gradle
@@ -1,5 +1,5 @@
apply plugin: 'com.android.library'
apply from: 'gradle-maven-push.gradle'
apply plugin: 'com.android.library'

android {
compileSdkVersion 27
Expand All @@ -9,7 +9,7 @@ android {
minSdkVersion 16
targetSdkVersion 27
versionCode 100
versionName "2.6.0-beta15"
versionName "2.6.0-signed3"
}
lintOptions {
abortOnError true
Expand Down Expand Up @@ -40,3 +40,11 @@ task javadoc(type: Javadoc) {
classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) + configurations.implementation
failOnError false
}

gradle.taskGraph.whenReady { taskGraph ->
if (taskGraph.allTasks.any { it instanceof Sign }) {
allprojects { ext."signing.keyId" = System.getenv("GRADLE_SIGNING_KEY_ID") }
allprojects { ext."signing.secretKeyRingFile" = "../secring.gpg" }
allprojects { ext."signing.password" = System.getenv("GRADLE_SIGNING_PASSWORD") }
}
}
Binary file added secrets.tar
Binary file not shown.
Binary file added secrets.tar.enc
Binary file not shown.
4 changes: 4 additions & 0 deletions sign.sh
Expand Up @@ -6,6 +6,10 @@ if [ -z "$TRAVIS_TAG" ]; then
exit 0
fi

./gradlew :LottieSample:assembleRelease

./gradlew -PNEXUS_USERNAME=$NEXUS_USERNAME -PNEXUS_PASSWORD=$NEXUS_PASSWORD :lottie:uploadArchives

echo "----------Signing APK"
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore lottie-upload-key.jks -storepass $LOTTIE_UPLOAD_CERT_KEY_STORE_PASSWORD LottieSample/build/outputs/apk/release/LottieSample-release-unsigned.apk upload -keypass $LOTTIE_UPLOAD_CERT_KEY_PASSWORD -signedjar LottieSample/build/outputs/apk/release/LottieSample-release-signed.apk

Expand Down

0 comments on commit 1718548

Please sign in to comment.