diff --git a/.travis.yml b/.travis.yml index 371ee3e2..856b7b4b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,21 +6,34 @@ android: - platform-tools - tools - build-tools-26.0.2 - - android-24 + - 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 + +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 + - 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" + 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 - -after_success: - - chmod +x ./upload_apk.sh - - ./upload_apk.sh - -script: cd android_app && ./gradlew testDebug assembleDebug + target_commitish: $TRAVIS_COMMIT + on: + branch: master 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 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