-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
53 lines (52 loc) · 2.55 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
language: android
sudo: false
android:
components:
- platform-tools
- tools
- 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 &
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
before_deploy:
# 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
# create tagged commit
- git config --global user.email "[email protected]"
- 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:
secure: ${GH_TOKEN}
file: $NEW_APK
skip_cleanup: true
on:
tags: false
branch: builds
branches:
except: /^*-v[0-9]/
env:
global:
secure: XsWfm7Y3j5tnk0pHBkd5kieqgkxZpxeitqOstTgQ+q++Q3FuCE9vJTj/6PWHKn9kmlELkRZFUvvcWi1JpyRYUjmcqCW1QXD+iwoZpA3XY3MeuZQycPL3AEBxOd+X6/T6F71ZtvPioVlyRUVjnCm2e8xRy58kC5oFLeTpAxxVxN4R5Vq0N0bixiKvb3W3QR1vvfAvh0wO5HO3+Fer08jqr/ZYC0InnA7o3aUIGHx6HXFKYyoWns/QxpF0IH2HRgp4fozjcA3skWMlnf0okTq20AHnSz+P2zc3rp4SNYbEsyqEVIgOG/+cy3qo8dRlChP7GbUGhWXMlSu2R+vnom5VL1wQitPZy/Cpxhk2cvEuYgmCUthtz57nm9sw7Gjj9irSNXb8fagOCKxOd5gyo3oOyJw6VAhrWSC5KT1fchXxbTLbev8KPRKcq21g2T4wWzWD0zPJqVE1ssCNBV3fdfRkXp5aVv+1lU/2t0yDCLh65eFkQEg2mScaJjqCsoNoz6dNZFwqjgWPLmq7g8dgDPS+Q2Kgp4HQyNxtTVNU8MqMPP9fp7giv4CooMfxMk9zkmD9CS0jkFKnWO3bBXNKjcr7n/BOiWvhWZgSJ29jSthI8t6z4IFd15V55pZSIjyjoTAAT3GoNa05O5Nkg/LqV7ZFMj+06mSfuYQohUQ40kvpckc=