From 12563fa7946b9763316356a8cf6693e8b6deea1d Mon Sep 17 00:00:00 2001 From: Erik Johansson Date: Mon, 1 Jan 2018 18:58:21 +0100 Subject: [PATCH 1/7] Update travis config to use android sdk 26 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 371ee3e2..169e0cec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ android: - platform-tools - tools - build-tools-26.0.2 - - android-24 + - android-26 - extra-android-m2repository deploy: From 1ccb717041972a5c83f32cd628cf9f9761131c96 Mon Sep 17 00:00:00 2001 From: Erik Johansson Date: Mon, 1 Jan 2018 19:14:50 +0100 Subject: [PATCH 2/7] Create explicit tag before deploying to github Also remove script and "rename" APK in before_deploy instead. --- .travis.yml | 16 +++++++++++----- android_app/upload_apk.sh | 4 ---- 2 files changed, 11 insertions(+), 9 deletions(-) delete mode 100755 android_app/upload_apk.sh diff --git a/.travis.yml b/.travis.yml index 169e0cec..eef97744 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,18 +9,24 @@ android: - android-26 - extra-android-m2repository +before_deploy: + - ln -s app/build/outputs/apk/debug/app-debug.apk openScale-dev-build.apk + - git tag -f travis-dev-build + - git remote add gh https://${TRAVIS_REPO_SLUG%/*}:${GITHUB_API_KEY}@github.com/${TRAVIS_REPO_SLUG}.git + - git push -f gh travis-dev-build + - git remote remove gh + deploy: provider: releases api-key: $GITHUB_API_KEY - file: $HOME/openScale-dev-build.apk + file: openScale-dev-build.apk skip_cleanup: true name: "openScale dev build" body: "Automatically openScale dev build by Travis CI" prerelease: true overwrite: true - -after_success: - - chmod +x ./upload_apk.sh - - ./upload_apk.sh + target_commitish: $TRAVIS_COMMIT + on: + branch: travis script: cd android_app && ./gradlew testDebug assembleDebug diff --git a/android_app/upload_apk.sh b/android_app/upload_apk.sh deleted file mode 100755 index 507b32c2..00000000 --- a/android_app/upload_apk.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -# copy apk file to home -cp app/build/outputs/apk/debug/app-debug.apk $HOME/openScale-dev-build.apk From 8c00e661fe588bc34b63228113ab18df900c5ee0 Mon Sep 17 00:00:00 2001 From: Erik Johansson Date: Mon, 1 Jan 2018 19:41:20 +0100 Subject: [PATCH 3/7] Include commit in version when building on travis --- .travis.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index eef97744..5f9aaba9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,11 @@ android: - android-26 - extra-android-m2repository +before_script: + - sed -i -re 's/(versionName ".*)"/\1-dev_'${TRAVIS_COMMIT:0:8}'"/' android_app/app/build.gradle + +script: cd android_app && ./gradlew testDebug assembleDebug + before_deploy: - ln -s app/build/outputs/apk/debug/app-debug.apk openScale-dev-build.apk - git tag -f travis-dev-build @@ -28,5 +33,3 @@ deploy: target_commitish: $TRAVIS_COMMIT on: branch: travis - -script: cd android_app && ./gradlew testDebug assembleDebug From d257276f2435eb20de2e15550fcc5d4af928fbee Mon Sep 17 00:00:00 2001 From: Erik Johansson Date: Mon, 1 Jan 2018 21:28:40 +0100 Subject: [PATCH 4/7] Don't build travis-dev-build tag --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 5f9aaba9..bc36fc37 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,10 @@ android: - android-26 - extra-android-m2repository +branches: + except: + - travis-dev-build + before_script: - sed -i -re 's/(versionName ".*)"/\1-dev_'${TRAVIS_COMMIT:0:8}'"/' android_app/app/build.gradle From e2b1f330c5af7664fe4dbad34f3062e4e4066d36 Mon Sep 17 00:00:00 2001 From: Erik Johansson Date: Mon, 1 Jan 2018 22:39:33 +0100 Subject: [PATCH 5/7] Include branch, commit and build time in release body --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index bc36fc37..7f6f7c41 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,8 +30,8 @@ deploy: api-key: $GITHUB_API_KEY file: openScale-dev-build.apk skip_cleanup: true - name: "openScale dev build" - body: "Automatically openScale dev build by Travis CI" + name: openScale development build + body: Automatic openScale development build of $TRAVIS_BRANCH ($TRAVIS_COMMIT) built by Travis CI on $(date +'%F %T %Z'). prerelease: true overwrite: true target_commitish: $TRAVIS_COMMIT From 05f4a8802ea15e3aead62654c774183825138289 Mon Sep 17 00:00:00 2001 From: Erik Johansson Date: Mon, 1 Jan 2018 22:56:03 +0100 Subject: [PATCH 6/7] Link directly to dev build release --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dd2bcbda..a812797d 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ openScale is an open source app which support various Bluetooth scales to keep e Get it on Google Play -Install [openScale-dev-build.apk](https://github.com/oliexdev/openScale/releases) to get the latest development build generated by [Travis CI](https://travis-ci.org/). But be aware that this version may contain bugs and you don't get any automatically updates. +Install [openScale-dev-build.apk](https://github.com/oliexdev/openScale/releases/tag/travis-dev-build) to get the latest development build generated by [Travis CI](https://travis-ci.org/). But be aware that this version may contain bugs and you don't get any automatically updates. # Features From 98e6449d6a7b0d7cdc4834e7984a714ba85ccfd4 Mon Sep 17 00:00:00 2001 From: Erik Johansson Date: Tue, 2 Jan 2018 00:23:34 +0100 Subject: [PATCH 7/7] Switch deploy branch back to master --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7f6f7c41..856b7b4b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,4 +36,4 @@ deploy: overwrite: true target_commitish: $TRAVIS_COMMIT on: - branch: travis + branch: master