forked from coolfire2015/RxFluxArchitecture
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
97 lines (97 loc) · 2.74 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
#声明构建语言环境
language: android
dist: trusty
#开启基于容器的Travis CI任务,让编译效率更高。
sudo: false
#Git配置
git:
#将git depth设置相对小的值,加快构建速度
depth: 3
#下载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-28.0.3
# The SDK version used to compile your project
- android-28
# 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"
#安装fir命令行客户端
- gem install fir-cli
#密钥
- echo -e "CLIENT_ID=\"$CLIENT_ID\"" >> local.properties
- echo -e "CLIENT_SECRET=\"$CLIENT_SECRET\"" >> local.properties
- echo -e "STORE_RELEASE_FILE=$STORE_RELEASE_FILE" >> local.properties
- echo -e "STORE_DEBUG_FILE=$STORE_DEBUG_FILE" >> local.properties
- echo -e "STORE_PASSWORD=$STORE_PASSWORD" >> local.properties
- echo -e "KEY_ALIAS=$KEY_ALIAS" >> local.properties
- echo -e "KEY_PASSWORD=$KEY_PASSWORD" >> local.properties
#脚本
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:
#fir账号的Token
- fir login $FIR_TOKEN
#打印身份信息,验证是否登录成功
- fir me
#自动发布应用至fir内测平台
- fir p release/outputs/apk/module-app-$TRAVIS_TAG-release.apk -c "`git cat-file tag $TRAVIS_TAG`"
#删除部署之后的apk
- rm release/outputs/apk/module-app-$TRAVIS_TAG-release.apk
#通知
notifications:
email:
recipients:
on_success: change
on_failure: always