diff --git a/.travis.yml b/.travis.yml index eb27a28..bc8d13b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,31 +7,35 @@ android: - build-tools-23.0.2 - android-23 before_script: -- echo no | android create avd --force -n test -t android-19 --abi armeabi-v7a -- emulator -avd test -no-skin -no-audio -no-window & -- android-wait-for-emulator -- adb shell input keyevent 82 & + - echo no | android create avd --force -n test -t android-19 --abi armeabi-v7a + - emulator -avd test -no-skin -no-audio -no-window & + - android-wait-for-emulator + - adb shell input keyevent 82 & before_install: -- echo yes | android update sdk --filter platform-tools --no-ui --force > /dev/null -- echo yes | android update sdk --filter android-18 --no-ui --force > /dev/null -- echo yes | android update sdk --filter sysimg-18 --no-ui --force > /dev/null -- echo yes | android update sdk --filter extra-android-support --no-ui --force > /dev/null -- echo yes | android update sdk --filter extra-android-m2repository --no-ui --force > /dev/null + - echo yes | android update sdk --filter platform-tools --no-ui --force > /dev/null + - echo yes | android update sdk --filter android-18 --no-ui --force > /dev/null + - echo yes | android update sdk --filter sysimg-18 --no-ui --force > /dev/null + - echo yes | android update sdk --filter extra-android-support --no-ui --force > /dev/null + - echo yes | android update sdk --filter extra-android-m2repository --no-ui --force > /dev/null before_deploy: -# get project version -- export GRADLE_PATH=./app/build.gradle -- export VERSION=$(grep "versionName" $GRADLE_PATH | awk '{print $2}') -- export GIT_TAG=$TRAVIS_BRANCH-$VERSION.$TRAVIS_BUILD_NUMBER +# read project version from gradle.build file + # variables + - export GRADLE_PATH=./app/build.gradle # path to the gradle file + - export GRADLE_FIELD="versionName" # field name + # logic + - export VERSION_TMP=$(grep $GRADLE_FIELD $GRADLE_PATH | awk '{print $2}') # get value versionName"0.1.0" + - export VERSION=$(echo $VERSION_TMP | sed -e 's/^"//' -e 's/"$//') # remove quotes 0.1.0 + - export GIT_TAG=$TRAVIS_BRANCH-$VERSION.$TRAVIS_BUILD_NUMBER # rename APK file -- export OLD_APK=app/build/outputs/apk/app-release-unsigned.apk -- export NEW_APK=app/build/outputs/apk/socko.apk -- mv $OLD_APK $NEW_APK + - export OLD_APK=app/build/outputs/apk/app-release-unsigned.apk + - export NEW_APK=app/build/outputs/apk/socko.apk + - mv $OLD_APK $NEW_APK # create tagged commit -- git config --global user.email "builds@travis-ci.com" -- git config --global user.name "Travis CI" -- git tag $GIT_TAG -a -m "Generated tag from TravisCI for build $TRAVIS_BUILD_NUMBER" -- git push -q https://${GH_TOKEN}@github.com/Vadammt/TravisTest --tags -- ls -aR + - git config --global user.email "builds@travis-ci.com" + - git config --global user.name "Travis CI" + - git tag $GIT_TAG -a -m "Generated tag from TravisCI for build $TRAVIS_BUILD_NUMBER" + - git push -q https://${GH_TOKEN}@github.com/Vadammt/TravisTest --tags + - ls -aR deploy: provider: releases api_key: @@ -40,7 +44,6 @@ deploy: skip_cleanup: true on: tags: false -# all_branches: true branch: builds branches: except: /^*-v[0-9]/