forked from moezbhatti/qksms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
98 lines (85 loc) · 4.46 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
language: android
jdk: oraclejdk8
sudo: false
notifications:
email:
on_success: change
on_failure: change
env:
global:
- COMPILE_API_LEVEL=29
- EMULATOR_API_LEVEL=24 # It seems emulator levels 25,26,27 from main repos have google_apis by default, and do not support armeabi-v7a. Check commit comment.
- EMULATOR_TAG=default # Possible values are default, google_apis, android-tv, android-wear, android-wear-cn
- EMULATOR_ABI=armeabi-v7a # Default is armeabi-v7a, possible options are: x86, x86_64, mips, arm64-v8a, armeabi-v7a. Note: check commit comment
- EMULATOR_NAME=qksms3
- ANDROID_BUILD_TOOLS_VERSION=29.0.2 # Match build-tools version used in build.gradle
- EMULATOR="system-images;android-${EMULATOR_API_LEVEL};${EMULATOR_TAG};${EMULATOR_ABI}" # Used to install/create emulator
android:
components:
- tools
- platform-tools
- tools
- extra
# The build tools used in the project
- build-tools-${ANDROID_BUILD_TOOLS_VERSION}
# The SDK used in the project
- android-${COMPILE_API_LEVEL}
# For running the emulator in Travis
- android-${EMULATOR_API_LEVEL}
- sys-img-${EMULATOR_ABI}-android-${EMULATOR_API_LEVEL}
# Set up Android-sdk and the emulator
before_install:
# Decrypt keystore and google-services.json
- openssl aes-256-cbc -K $encrypted_4d1d940e2c65_key -iv $encrypted_4d1d940e2c65_iv -in secrets.tar.enc -out secrets.tar -d
- tar xvf secrets.tar
- echo 'count=0' > /home/travis/.android/repositories.cfg # Avoid warning
- ls -lar $HOME/**/*
# List and delete unnecessary components to free space
- sdkmanager --list || true # Print out package list for debug purposes
- sdkmanager --uninstall "extras;google;google_play_services"
- yes | sdkmanager "tools" # Update tools
- yes | sdkmanager "platforms;android-${EMULATOR_API_LEVEL}" # Android platform required by emulator
- yes | sdkmanager "platforms;android-${COMPILE_API_LEVEL}" # Android platform required by compiler
- yes | sdkmanager "build-tools;${ANDROID_BUILD_TOOLS_VERSION}" # Android build tools
- yes | sdkmanager "${EMULATOR}" # Install emulator system image
- sdkmanager --list || true # Print out package list for debug purposes
# Run the emulator
install:
# emulator instance
- echo no | android create avd --force -n ${EMULATOR_NAME} -k "${EMULATOR}"
# Run emulator in a subshell, this seems to solve the travis QT issue
- ( cd "$(dirname "$(which emulator)")" && ./emulator -avd ${EMULATOR_NAME} -verbose -show-kernel -selinux permissive -no-audio -no-window -no-boot-anim -wipe-data & )
- android-wait-for-emulator
- adb shell settings put global window_animation_scale 0 &
- adb shell settings put global transition_animation_scale 0 &
- adb shell settings put global animator_duration_scale 0 &
- sleep 30
- adb shell input keyevent 82 &
- adb devices
# Gradle setup
before_script:
- cd ${TRAVIS_BUILD_DIR}
- ./gradlew --version
- ./gradlew clean
# Build APK
script:
- |
./gradlew :presentation:assembleWithAnalyticsRelease :presentation:bundleWithAnalyticsRelease assembleAndroidTest -PtestCoverageEnabled='true'
retval=$?
if [$retval -ne 0]; then
echo "error on assembling, exit code: "$retval
exit $retval
fi
# Deploy APK
deploy:
provider: releases
skip_cleanup: true
overwrite: true
api_key:
secure: XF7V/I02gpyOzCAFXEFyrThXVUUnKjSaWQ8lppO50mVtdugimjWIPtHrcYASaJQf9INhqo0lamk+khPxtKxc1BSCp8o+c22UKcpczyjD4kK27a3zKfuNQWteBRjCH34vIGnrRFSHSWYLIgeuoIK3q5Lq4IBK/Od3mfpRaDt1ER+IqMzR3L205x1H8dW3MVuxXgdnq3jHlRpq86oOe293+dnblVCtWUvAzwhZPnnbBc4JUaNomMI7dLJ/pAigByCoHHmG9pc2Cky1yyWVAnTZFAlf2PbzPDLRRnXmHuYKfHxiZgd/l8JTiZdhky9cXgFoSxvJyDABRqqLxVNfXt2ZwgdtiulZml8RB1FB0L37qL72mxWgi6y9IbQgt/FG20K2QpSBglk0bCGLS+h5Yz3kV4fhsBY7llpWGw14BvlAx9sUfl3Ej+IUsWoJgA00TFNGDG8sMyOFoCQVz/sB4Dv4h+JfynJZcmm8okcfYrWBHOoHY7cH3chBWp/2A736f2A/aqnBd6z8a03toe2ILC9eSOiIhrVxPyqLmEKBD1rCduVFNteqGwm9G9YwKpvFibTqu0gqEtfF7cmuMH6M5PYExI5EzoewZTYmgp02+lBuFAEMvycVvXcu8VfeeT6cgeLlmz2hsbo93UfoSQyP+gSojMOOkVUsl6mIp1STLiJ5IRY=
file:
- /home/travis/build/moezbhatti/qksms/presentation/build/outputs/bundle/withAnalyticsRelease/presentation.aab
- /home/travis/build/moezbhatti/qksms/presentation/build/outputs/apk/withAnalytics/release/presentation-withAnalytics-release.apk
on:
repo: moezbhatti/qksms
tags: true