-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
82 lines (69 loc) · 1.86 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: python
#cahce pip files
cache:
- pip
git:
depth: 2
branches:
only:
- master
- /^[vV](\d+\.){1,3}\d+/
env:
global:
- GH_REF: "NewFuture/NKUWLAN.git"
- GIT_URL: "https://${GH_TOKEN}@github.com/${GH_REF}"
- BUILD_PATH: "build/"
- NAME: "From-Travis-CI"
- EMAIL: "github@newfuture.cc"
- CHANGE: "'git status min.py -s'"
- EMOJI: "'eval curl -sL https://newfuture.github.io/emoji/e.sh|bash'"
# 安装mimipy
install:
- pip install minipy-ppf
# 配置git环境
before_script:
# echo $ID_RSA>t.rsa &&base64 -d t.rsa>~/.ssh/id_rsa &&rm t.rsa &&chmod 600 ~/.ssh/id_rsa
- git config --global user.name $NAME
- git config --global user.email $EMAIL
- git clone -b build "${GIT_URL}" ${BUILD_PATH}
# 编译,检查,压缩,发布
script:
# build
- ./build.py ${BUILD_PATH}/nkuwlan.py && cd ${BUILD_PATH}
# check syntax and minify
- python -m py_compile nkuwlan.py
&& ./nkuwlan.py -v
&& minipy -D -R --noselftest -o min.py nkuwlan.py
&& ../build.py min.py min.py
&& python -m py_compile min.py
# check is runable and push when changed
- ./min.py -v
&& if [[ `$CHANGE` ]];then
git commit -am "`$EMOJI` Auto Build"
&& git push -fq ${GIT_URL} build:build
&& git checkout gh-pages;
fi
# 同步更新 submodules
after_success:
- if [ $(git rev-parse --abbrev-ref HEAD) == 'gh-pages' ] ;then
git submodule update --init --recursive
&& git submodule foreach --recursive git pull origin build
&& git commit -am "`$EMOJI` Auto update Submodule"
&& git push -q "${GIT_URL}" gh-pages:gh-pages;
fi
# 自动release
before_deploy:
- "git checkout build"
deploy:
provider: releases
api_key: "${GH_TOKEN}"
file:
- "nkuwlan.py"
- "min.py"
skip_cleanup: true
on:
tags: true
notifications:
email:
on_failure: change
on_success: change