-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy path.travis.yml
82 lines (82 loc) · 2.14 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
#声明构建语言环境
language: android
dist: trusty
#开启基于容器的Travis CI任务,让编译效率更高。
sudo: false
#Git配置
git:
#Travis CI可以clone存储库最大50次commit,这只有在执行git操作时才真正有用。
#将git depth设置的值就是clone commit的次数,设置false取消clone commit次数限制。
depth: false
#下载jdk8
jdk: oraclejdk8
#Android配置
android:
#配置信息
components:
# Uncomment the lines below if you want to
# use the latest revision of Android SDK Tools
#- tools
#- platform-tools
# The BuildTools version used by your project
- build-tools-29.0.2
# The SDK version used to compile your project
- android-29
# Additional components
#- extra-google-google_play_services
#- extra-google-m2repository
- extra-android-m2repository
licenses:
- 'android-sdk-preview-license-52d11cd2'
- 'android-sdk-license-.+'
- 'google-gdk-license-.+'
#缓存之前
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
#极早的流程步骤
before_install:
#改变gradlew的访问权限
- chmod +x gradlew
- yes | sdkmanager "platforms;android-28"
#脚本
script:
- ./gradlew clean
- ./gradlew assembleRelease
#部署之前
before_deploy:
- ls release/outputs/apk/
#部署
deploy:
#部署到GitHub Release
provider: releases
#填写GitHub的token
api_key:
secure: ${GH_TOKEN}
#部署文件路径
file: release/outputs/apk/module-app-$TRAVIS_TAG-release.apk
#默认情况下Travis CI在完成编译后会清除所有生成的文件,设置为true以跳过清理
skip_cleanup: true
#部署时机
on:
tags: true
all_branches: true
#部署到GitHub仓库
repo: coolfire2015/RxFluxArchitecture
#部署之后
after_deploy:
#删除部署之后的apk
- rm release/outputs/apk/module-app-$TRAVIS_TAG-release.apk
#通知
notifications:
email:
recipients:
on_success: change
on_failure: always