diff --git a/.travis.yml b/.travis.yml index d310dcc667..ccabc5a98b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,28 +13,33 @@ android: - extra-android-m2repository -deploy: - provider: releases - api_key: "${GITHUB_API_KEY}" - file_glob: true - file: app/build/outputs/apk/*/*.apk - skip_cleanup: true - on: - tags: true +cache: + directories: + - $HOME/.gradle/caches/ + - $HOME/.gradle/wrapper/ + - $HOME/.android/build-cache before_script: - chmod +x ./ci/prepare_env.sh - chmod +x ./ci/build_debug.sh + - chmod +x ./ci/notify_slack.sh + +before_cache: + - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock + - rm -fr $HOME/.gradle/caches/*/plugin-resolution/ script: - ./ci/prepare_env.sh - ./ci/build_debug.sh -before_cache: - - 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 \ No newline at end of file +deploy: + provider: releases + api_key: "${GITHUB_API_KEY}" + file_glob: true + file: app/build/outputs/apk/*/*.apk + skip_cleanup: true + on: + tags: true + +after_deploy: + - ./ci/notify_slack.sh \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 328d3f035c..693a69cd71 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -13,7 +13,11 @@ android { versionCode getInt("APP_VERSION_CODE", 1) versionName getKey("APP_VERSION_NAME", "1.0") testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + vectorDrawables.useSupportLibrary = true + + project.ext.set("archivesBaseName", String.format("gnosis_authenticator_%s", defaultConfig.versionCode)) + javaCompileOptions { annotationProcessorOptions { arguments = ["room.schemaLocation": diff --git a/ci/notify_slack.sh b/ci/notify_slack.sh new file mode 100644 index 0000000000..25b85e3ebd --- /dev/null +++ b/ci/notify_slack.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# fail if any commands fails +set -e + +repo_url="$(git config --get remote.origin.url)" +release_path="/releases/tag/${TRAVIS_TAG}" +release_url="${repo_url/.git/$release_path}" +curl -X POST -H 'Content-type: application/json' \ +--data "{\"text\":\"<${release_url}|Version ${APP_VERSION_NAME}> for ${TRAVIS_REPO_SLUG} is out!\"}" \ +https://hooks.slack.com/services/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 \ No newline at end of file diff --git a/ci/prepare_env.sh b/ci/prepare_env.sh index 06f70fb48c..bbafd06a61 100644 --- a/ci/prepare_env.sh +++ b/ci/prepare_env.sh @@ -5,6 +5,6 @@ set -e # write your script here export APP_VERSION_CODE=$TRAVIS_BUILD_NUMBER # strip the first char as that should always be "v" (as tags should be in the format "vX.X.X") -# description="$(git describe --tags)" -export APP_VERSION_NAME=$TRAVIS_BUILD_NUMBER #${description:1} +description="$(git describe --tags)" +export APP_VERSION_NAME=${description:1} export APP_RELEASE_NOTES=$TRAVIS_COMMIT_MESSAGE