forked from oliexdev/openScale
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
65 lines (58 loc) · 1.89 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
54
55
56
57
58
59
60
61
62
63
64
65
language: android
jdk: oraclejdk8
android:
components:
- platform-tools
- tools
- build-tools-27.0.2
- android-27
- extra-android-m2repository
branches:
except:
- travis-dev-build
before_install:
- yes | sdkmanager "platforms;android-27"
- yes | sdkmanager "platforms;android-26"
before_script:
- sed -i -r
-e 's/applicationId "[^"]+/\0.dev/'
-e 's/(versionCode ).*/\1'$(date +%s)'/'
-e 's/versionName "[^"]+/\0-dev_'${TRAVIS_COMMIT:0:8}'/'
android_app/app/build.gradle
- sed -i -r
-e 's/(<string name="app_name">[^<]+)/\1 (dev)/'
android_app/app/src/main/res/values*/strings.xml
# Create keystore by running:
# keytool -genkey -v -keystore debug.keystore -storepass android \
# -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 \
# -validity 10000 -dname "CN=Android Debug,O=Android,C=US"
#
# Then base64 encode it with:
# base64 -w0 debug.keystore
#
# Then add this to Travis environment variables as DEBUG_KEYSTORE (make sure
# not to enable displaying value in build logs)"
- test -n "$DEBUG_KEYSTORE"
&& echo "$DEBUG_KEYSTORE" | base64 -d > $HOME/.android/debug.keystore
|| true
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: openScale-dev-build.apk
skip_cleanup: true
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
on:
branch: master