diff options
author | Gabriel Peal <gpeal@users.noreply.github.com> | 2018-08-05 16:53:54 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-05 16:53:54 -0700 |
commit | f675a5575db138e759f09e71806d1a913539ecd0 (patch) | |
tree | 1d4fce2eee7739ea4eb74f581c014f23e70fb135 | |
parent | afef4edf2e982da814c3afd7970754a221aca111 (diff) | |
download | lottie-f675a5575db138e759f09e71806d1a913539ecd0.tar.gz |
Sign and create releases on CI (#866)
-rw-r--r-- | .travis.yml | 99 | ||||
-rw-r--r-- | LottieSample/build.gradle | 4 | ||||
-rw-r--r-- | gradle.properties | 2 | ||||
-rw-r--r-- | lottie-upload-key.jks.enc | bin | 0 -> 2176 bytes | |||
-rw-r--r-- | lottie/build.gradle | 5 | ||||
-rwxr-xr-x | sign.sh | 17 | ||||
-rwxr-xr-x | version.sh | 13 |
7 files changed, 93 insertions, 47 deletions
diff --git a/.travis.yml b/.travis.yml index 65150f7a..45edaa10 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,59 +1,76 @@ -# https://cloud.google.com/solutions/continuous-delivery-with-travis-ci language: android group: travis_lts before_cache: - - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock - - rm -fr $HOME/.gradle/caches/*/plugin-resolution/ +- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock +- rm -fr $HOME/.gradle/caches/*/plugin-resolution/ cache: directories: - - $HOME/.gradle/caches/ - - $HOME/.gradle/wrapper/ - - $HOME/.android/build-cache - - "$HOME/.m2" - - "$HOME/google-cloud-sdk/" - - "$HOME/.cache" + - "$HOME/.gradle/caches/" + - "$HOME/.gradle/wrapper/" + - "$HOME/.android/build-cache" + - "$HOME/.m2" + - "$HOME/google-cloud-sdk/" + - "$HOME/.cache" + - "$TRAVIS_BUILD_DIR/build" + - "$TRAVIS_BUILD_DIR/lottie/build" + - "$TRAVIS_BUILD_DIR/LottieSample/build" env: - - PATH=${HOME}/google-cloud-sdk/bin:$PATH CLOUDSDK_CORE_DISABLE_PROMPTS=1 +- PATH=${HOME}/google-cloud-sdk/bin:$PATH CLOUDSDK_CORE_DISABLE_PROMPTS=1 before_install: - - 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) - - export GIT_MERGE_BASE=$(git merge-base master) - - echo GIT_SHA $GIT_SHA - - echo GIT_MERGE_BASE $GIT_MERGE_BASE +- openssl aes-256-cbc -K $encrypted_7f6a0d70974a_key -iv $encrypted_7f6a0d70974a_iv + -in lottie-upload-key.jks.enc -out lottie-upload-key.jks -d +- 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) +- export GIT_MERGE_BASE=$(git merge-base master) +- echo GIT_SHA $GIT_SHA +- echo GIT_MERGE_BASE $GIT_MERGE_BASE install: - - . $HOME/.nvm/nvm.sh - - nvm install stable - - nvm use stable - - npm install +- ". $HOME/.nvm/nvm.sh" +- nvm install stable +- nvm use stable +- npm install android: components: - - tools - - platform-tools - - tools - - - build-tools-27.0.3 - - android-27 - - extra-android-m2repository + - tools + - platform-tools + - tools + - build-tools-27.0.3 + - android-27 + - extra-android-m2repository jdk: - - oraclejdk8 +- oraclejdk8 branches: except: - - gh-pages + - gh-pages notifications: email: false jobs: include: - - stage: "test" - name: "Lottie Lint" - script: ./gradlew :lottie:lintRelease - - name: "Lottie Unit Tests" - script: ./gradlew :lottie:testReleaseUnitTest - - name: "LottieSample Lint" - script: ./gradlew :LottieSample:lintRelease - - name: "LottieSample Unit Tests" - script: ./gradlew :LottieSample:testReleaseUnitTest - - name: "Firebase Happo Tests" - script: - - ./gradlew :LottieSample:assembleDebug :LottieSample:assembleAndroidTest - - ./gcloud_run.sh + - stage: test + name: Lottie Lint + script: "./gradlew :lottie:lintRelease" + - name: Lottie Unit Tests + script: "./gradlew :lottie:testReleaseUnitTest" + - name: LottieSample Lint + script: "./gradlew :LottieSample:lintRelease" + - name: LottieSample Unit Tests + script: "./gradlew :LottieSample:testReleaseUnitTest" + - name: Firebase Happo Tests + script: + - "./gradlew :LottieSample:assembleDebug :LottieSample:assembleAndroidTest" + - "./gcloud_run.sh" + - 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 + deploy: + provider: releases + api_key: $GITHUB_ACCESS_TOKEN + file: LottieSample/build/outputs/apk/release/LottieSample-release-aligned.apk + skip_cleanup: true + on: + tags: true sudo: false diff --git a/LottieSample/build.gradle b/LottieSample/build.gradle index 6e77ceb8..e3f172ab 100644 --- a/LottieSample/build.gradle +++ b/LottieSample/build.gradle @@ -12,8 +12,8 @@ android { applicationId "com.airbnb.lottie" minSdkVersion 16 targetSdkVersion 27 - versionCode 42 - versionName "2.5.7" + versionCode 56 + versionName "2.6.0-beta15" multiDexEnabled true testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true diff --git a/gradle.properties b/gradle.properties index 98fed1d7..8d73be90 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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.5.7 +VERSION_NAME=2.6.0-beta15 GROUP=com.airbnb.android POM_DESCRIPTION=Lottie is an animation library that renders Adobe After Effects animations natively in realtime. diff --git a/lottie-upload-key.jks.enc b/lottie-upload-key.jks.enc Binary files differnew file mode 100644 index 00000000..3fbf4723 --- /dev/null +++ b/lottie-upload-key.jks.enc diff --git a/lottie/build.gradle b/lottie/build.gradle index 078abfe6..66af0cf3 100644 --- a/lottie/build.gradle +++ b/lottie/build.gradle @@ -9,7 +9,7 @@ android { minSdkVersion 16 targetSdkVersion 27 versionCode 100 - versionName "2.5.7" + versionName "2.6.0-beta15" } lintOptions { abortOnError true @@ -36,6 +36,7 @@ dependencies { task javadoc(type: Javadoc) { source = android.sourceSets.main.java.srcDirs - classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) + configurations.implementation.setCanBeResolved(true) + classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) + configurations.implementation failOnError false } diff --git a/sign.sh b/sign.sh new file mode 100755 index 00000000..d44efee7 --- /dev/null +++ b/sign.sh @@ -0,0 +1,17 @@ +#! /bin/bash + +if [ -z "$TRAVIS_TAG" ]; then + # Only sign and deploy tags + echo "Not signing build. There is no git tag." + exit 0 +fi + +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 + +if [ $? -ne 0 ]; then + exit $? +fi + +echo "----------Zipaligning APK" +${ANDROID_HOME}/build-tools/27.0.3/zipalign 4 LottieSample/build/outputs/apk/release/LottieSample-release-unsigned.apk LottieSample/build/outputs/apk/release/LottieSample-release-aligned.apk @@ -1,4 +1,9 @@ #!/bin/bash +git diff-index --quiet HEAD -- + +if [ $? -ne 0 ]; then + echo "Working tree must be empty before bumping the version" +fi sed -i '' "s/ versionName \".*\"/ versionName \"$1\"/" lottie/build.gradle @@ -8,4 +13,10 @@ sed -i '' "s/ versionCode .*/ versionCode $versionCode/" LottieSample/buil sed -i '' "s/VERSION_NAME=.*/VERSION_NAME=$1/" gradle.properties -sed -i '' "s/ compile 'com[.]airbnb[.]android[:]lottie[:].*'/ compile 'com\.airbnb\.android\:lottie\:$1'/" README.md
\ No newline at end of file +sed -i '' "s/ compile 'com[.]airbnb[.]android[:]lottie[:].*'/ compile 'com\.airbnb\.android\:lottie\:$1'/" README.md + +git add -A +git commit -m "v$1" +git tag "v$1" +git push --follow-tags +git push origin v$1
\ No newline at end of file |