-
Notifications
You must be signed in to change notification settings - Fork 6
/
.travis.yml
101 lines (87 loc) · 4.4 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
language: android
dist: trusty
jdk: oraclejdk8
branches:
only:
- master
- development
- /^[0-9].*/
env:
global:
- ADB_INSTALL_TIMEOUT=8
- ABI=x86_64
- EMU_FLAVOR=default # use google_apis flavor if no default flavor emulator
# PATH order is incredibly important. e.g. the 'emulator' script exists in more than one place!
- ANDROID_HOME=/usr/local/android-sdk
- TOOLS=${ANDROID_HOME}/tools
- PATH=${ANDROID_HOME}:${ANDROID_HOME}/emulator:${TOOLS}:${TOOLS}/bin:${ANDROID_HOME}/platform-tools:${PATH}
- API=21 #just one test on api 21
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
before_install:
- export ANDROID_NDK_HOME=./android-ndk-r20
- 'if [[ ! -d "$ANDROID_NDK_HOME" ]] ;
then
rm -fr $ANDROID_NDK_HOME;
curl -L https://dl.google.com/android/repository/android-ndk-r20-linux-x86_64.zip -O;
unzip -oq android-ndk-r20-linux-x86_64.zip;
ls -ltr $ANDROID_NDK_HOME;
ls -ltr $ANDROID_NDK_HOME/platforms;
rm android-ndk-r20-linux-x86_64.zip;
fi'
android:
components:
# installing tools to start, then use `sdkmanager` below to get the rest
- tools
licenses:
- 'android-sdk-preview-license-.+'
- 'android-sdk-license-.+'
- 'google-gdk-license-.+'
# Emulator Management: Create, Start and Wait
install:
- echo 'count=0' > /home/travis/.android/repositories.cfg # Avoid harmless sdkmanager warning
- echo y | sdkmanager "platform-tools" >/dev/null
- echo y | sdkmanager "tools" >/dev/null # A second time per Travis docs, gets latest versions
- echo y | sdkmanager "platforms;android-$API" >/dev/null # We need the API of the emulator we will run
- echo y | sdkmanager "platforms;android-32" >/dev/null # We need the API of the current compileSdkVersion from gradle.properties
- echo y | sdkmanager --channel=4 "emulator" >/dev/null # Use canary channel to get emulator 29.x for x86_64 image support
- echo y | sdkmanager "extras;android;m2repository" >/dev/null
- echo y | sdkmanager "system-images;android-$API;$EMU_FLAVOR;$ABI" >/dev/null # install our emulator
- echo no | avdmanager create avd --force -n test -k "system-images;android-$API;$EMU_FLAVOR;$ABI" -c 10M
- emulator -verbose -avd test -no-accel -no-snapshot -no-window $AUDIO -camera-back none -camera-front none -selinux permissive -qemu -m 2048 &
- adb shell input keyevent 82 &
script:
- ./gradlew build assembleDebug
- android-wait-for-emulator
- adb shell input keyevent 82 &
- ./gradlew connectedCheck
after_success:
- wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh
- chmod +x send.sh
- ./send.sh success $WEBHOOK_URL
after_failure:
- wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh
- chmod +x send.sh
- ./send.sh failure $WEBHOOK_URL
before_deploy:
- echo building signed release
- openssl aes-256-cbc -K $encrypted_03208d80b1d9_key -iv $encrypted_03208d80b1d9_iv -in keystore/zebra.jks.enc -out keystore/zebra.jks -d
- openssl aes-256-cbc -K $encrypted_913a23d5a238_key -iv $encrypted_913a23d5a238_iv -in keystore/api-playstore.json.enc -out keystore/api-playstore.json -d
- ./gradlew build uploadCrashlyticsSymbolFileRelease publishBundle -Preversatile_key_alias=${reversatile_key_alias} -Preversatile_key_password=${reversatile_key_password} -Preversatile_keystore_password=${reversatile_keystore_password}
- ./gradlew assembleRelease
- git status
- find . -name *.apk
deploy:
provider: releases
api_key:
secure: OzY2HHyFmcop+412mV/XXSrbqb8T6T4K5ATr8rP4YZXWnrtRU7HvAcfYkQQNvU5d+9pBA2D6nP3ZW7R9Ia/rdT/ysylJtOM3hR+8wwVNKoa8unxHzUgQgn3txxos1VxLON5vzR4lhyNpo8j+Di3Xcb5EVw/+g7HKbr7pytAkBnvAdv4vGW4B0SFwiFpHrSLlW/5uL8BKGmi/oG4sJGKNt5UE6Z0RCtj7YgesNyDwMGtMvGBXj5PdISgETCy3ZdYCRR1G7Y4Oeqfw3LAmv9C54MrFZlNdXzAbuGhEXKy8UDLD0uYWXOsxq9xpmfE3Xw79HCqqmHXfMmuf1IO3Tgit1a/aN6CWC33fH+cMt3h9C0ulGHnrUpLKNC7xlQeP66TjPDtYQYhvnAGF8Ps7yYyjpExrREsh9ShKJPVhtfWCPQQCaCygcWTUD4JLwRr4gy0d14cpOUNVIJ5ja/u+oGCy16VZ7PFeOLiZbZQ8IWrYSRh1Rdxn/9q0ac8hAlj24QwIDTbhAHh+JgRbkCxIAPiZ+bDQCkLKe6MM9Vt7H9Yox2f83cIVfPLj9bZKRb2FuLRWtXezB41pU7Hk/+AnfLyM/hyELKE8tCe8h6yQCEIB/iPiCd1SbCYmZ0gChz4egaBCAQgJXJ+mQd8XjYnrbERbG6HK/GHsH66WLQKMbwpRVKY=
file_glob: true
file: "./project/build/outputs/apk/release/reversatile-release-*-signed.apk"
skip_cleanup: true
on:
repo: oers/reversatile
tags: true