forked from kiwix/kiwix-android
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.travis.yml
More file actions
102 lines (82 loc) · 2.85 KB
/
.travis.yml
File metadata and controls
102 lines (82 loc) · 2.85 KB
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
101
102
language: android
jdk: oraclejdk8
sudo: required
dist: trusty
env:
global:
# switch glibc to a memory conserving mode
- MALLOC_ARENA_MAX=2
- ANDROID_TARGET=android-19
- ANDROID_ABI=armeabi-v7a
if: type != push OR tag IS present
before_install:
- openssl aes-256-cbc -K $encrypted_82adfa9c3806_key -iv $encrypted_82adfa9c3806_iv -in secrets.tar.enc -out secrets.tar -d
- tar xvf secrets.tar
install:
- pip install --user 'requests[security]'
- wget -r -nH -nd -np -R index.html* robots.txt* http://download.kiwix.org/dev/android/api/licenses/ -e robots=off -P $ANDROID_HOME/licenses || true
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- "$HOME/.gradle/caches/"
- "$HOME/.gradle/wrapper/"
- "$HOME/.android/build-cache"
android:
components:
- build-tools-28.0.3
- android-28
- extra-android-m2repository
- $ANDROID_TARGET
- sys-img-${ANDROID_ABI}-${ANDROID_TARGET}
licenses:
- ".+"
before_script:
- chmod +x gradlew
- echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI -c 100M
- emulator -avd test -no-audio -no-window &
- android-wait-for-emulator
- adb shell input keyevent 82 &
script:
- ./gradlew jacocoInstrumentationTestReport ktlintCheck lint jacocoTestReport app:assembleRelease
after_success:
- bash <(curl -s https://codecov.io/bash)
before_deploy:
# - export APP_CHANGELOG=$(cat app/src/kiwix/play/release-notes/en-US/default.txt)
- export DATE=$(date +%Y-%m-%d)
- export OUTPUT_DIR=app/build/outputs/apk
- export UNIVERSAL_RELEASE_APK=$OUTPUT_DIR/release/*universal*.apk
- export UNIVERSAL_DEBUG_APK=$OUTPUT_DIR/debug/*universal*.apk
- export SSH_KEY=travisci_builder_id_key
- chmod 600 $SSH_KEY
deploy:
#publish on github releases
- provider: releases
api_key: "$GITHUB_TOKEN"
file: $OUTPUT_DIR/release/*
file_glob: true
skip_cleanup: true
overwrite: true
#body: "$APP_CHANGELOG" broken because travis can't escape newlines https://github.com/travis-ci/dpl/issues/155
draft: true
on:
tags: true
#publish on play store
- provider: script
skip_cleanup: true
script: ./gradlew publishRelease
on:
tags: true
#publish release on download.kiwix.org
- provider: script
skip_cleanup: true
script: mkdir $TRAVIS_TAG && cp $UNIVERSAL_RELEASE_APK $TRAVIS_TAG && scp -vrp -i ${SSH_KEY} -o StrictHostKeyChecking=no $TRAVIS_TAG ci@download.kiwix.org:/data/download/release/kiwix-android/
on:
tags: true
#publish debug nightly on download.kiwix.org
- provider: script
skip_cleanup: true
script: mkdir $DATE && cp $UNIVERSAL_DEBUG_APK $DATE && scp -vrp -i ${SSH_KEY} -o StrictHostKeyChecking=no $DATE ci@download.kiwix.org:/data/download/nightly/
on:
branch: develop