forked from kuoruan/openwrt-v2ray
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
217 lines (217 loc) · 11.5 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
dist: xenial
notifications:
email: false
language: c
compiler: gcc
cache:
ccache: true
directories:
- "${HOME}/dl"
- "${HOME}/files"
- "${HOME}/feeds"
git:
depth: 3
submodules: false
addons:
apt:
packages:
- subversion
- build-essential
- libncurses5-dev
- zlib1g-dev
- gettext
- libssl-dev
- zip
env:
global:
- PACKAGE=v2ray-core
- DOWNLOAD_DIR=${HOME}/files
- CONFIG_CCACHE=y
jobs:
include:
- &compile-staging # x86-64
stage: compile
env: SDK_URL=https://downloads.openwrt.org/snapshots/targets/x86/64/openwrt-sdk-x86-64_gcc-8.3.0_musl.Linux-x86_64.tar.xz
before_install:
- export SDK_URL_PATH="$(dirname "$SDK_URL")"
- export SDK_NAME="$(basename "$SDK_URL")"
- test -d "$DOWNLOAD_DIR" || mkdir -p "$DOWNLOAD_DIR"
- cd "$DOWNLOAD_DIR"
- |
if ! ( wget -q -O - "${SDK_URL_PATH}/sha256sums" | \
grep "$SDK_NAME" > sha256sums.small 2>/dev/null ) ; then
echo "Can not find ${SDK_NAME} file in sha256sums."
exit 1
fi
- |
if ! sha256sum -c ./sha256sums.small 2>/dev/null ; then
wget -q -O "$SDK_NAME" "$SDK_URL"
if ! sha256sum -c ./sha256sums.small 2>/dev/null ; then
echo "SDK can not be verified!"
exit 1
fi
fi
- file "${DOWNLOAD_DIR}/${SDK_NAME}"
install:
- test -d "${HOME}/dl" || mkdir -p "${HOME}/dl"
- test -d "${HOME}/feeds" || mkdir -p "${HOME}/feeds"
- export SDK_HOME="$(mktemp -d)"
- tar -Jxf "${DOWNLOAD_DIR}/${SDK_NAME}" -C "$SDK_HOME" --strip=1
- cd "$SDK_HOME"
- test -d "dl" && rm -rf dl || true
- test -d "feeds" && rm -rf feeds || true
- ln -s "${HOME}/dl/" dl
- ln -s "${HOME}/feeds" feeds
- cat feeds.conf.default >feeds.conf
- sed -i 's#git.openwrt.org/openwrt/openwrt#github.com/openwrt/openwrt#' feeds.conf
- sed -i 's#git.openwrt.org/feed/packages#github.com/openwrt/packages#' feeds.conf
- sed -i 's#git.openwrt.org/project/luci#github.com/openwrt/luci#' feeds.conf
- sed -i 's#git.openwrt.org/feed/telephony#github.com/openwrt/telephony#' feeds.conf
- ln -s "$TRAVIS_BUILD_DIR" "package/${PACKAGE}"
before_script:
- cd "$SDK_HOME"
- ./scripts/feeds update -a
- |
test -d ./feeds/packages/net/v2ray-core && \
rm -rf ./feeds/packages/net/v2ray-core || true
- |
test -d ./feeds/packages/lang/golang && \
rm -rf ./feeds/packages/lang/golang || true
- |
curl https://codeload.github.com/openwrt/packages/tar.gz/master | \
tar -xz -C ./feeds/packages/lang --strip=2 packages-master/lang/golang
- ./scripts/feeds install -a
- make defconfig
script:
- cd "$SDK_HOME"
- make package/${PACKAGE}/compile V=s
after_success:
- find "${SDK_HOME}/bin/" -type f -exec ls -lh {} \;
before_deploy:
- find "${SDK_HOME}/bin/" -name v2*.ipk -exec cp {} "$TRAVIS_BUILD_DIR" \;
- ls -hl "$TRAVIS_BUILD_DIR" | grep .*\.ipk
deploy:
provider: releases
file_glob: true
file: "${TRAVIS_BUILD_DIR}/*.ipk"
cleanup: false
edge: true
on:
tags: true
all_branches: true
token: $GITHUB_TOKEN
- <<: *compile-staging # i386_pentium
if: tag IS present OR env(BUILD_ALL) = 1
env: SDK_URL=https://downloads.openwrt.org/snapshots/targets/x86/legacy/openwrt-sdk-x86-legacy_gcc-8.3.0_musl.Linux-x86_64.tar.xz
- <<: *compile-staging # i386_pentium4
if: tag IS present OR env(BUILD_ALL) = 1
env: SDK_URL=https://downloads.openwrt.org/snapshots/targets/x86/generic/openwrt-sdk-x86-generic_gcc-8.3.0_musl.Linux-x86_64.tar.xz
- <<: *compile-staging # aarch64_cortex-a53
if: tag IS present OR env(BUILD_ALL) = 1
env: SDK_URL=https://downloads.openwrt.org/snapshots/targets/brcm2708/bcm2710/openwrt-sdk-brcm2708-bcm2710_gcc-8.3.0_musl.Linux-x86_64.tar.xz
- <<: *compile-staging # aarch64_cortex-a72
if: tag IS present OR env(BUILD_ALL) = 1
env: SDK_URL=https://downloads.openwrt.org/snapshots/targets/mvebu/cortexa72/openwrt-sdk-mvebu-cortexa72_gcc-8.3.0_musl.Linux-x86_64.tar.xz
- <<: *compile-staging # aarch64_generic
if: tag IS present OR env(BUILD_ALL) = 1
env: SDK_URL=http://downloads.openwrt.org/snapshots/targets/layerscape/armv8_64b/openwrt-sdk-layerscape-armv8_64b_gcc-8.3.0_musl.Linux-x86_64.tar.xz
#- <<: *compile-staging # arc_arc700
# if: tag IS present OR env(BUILD_ALL) = 1
# env: SDK_URL=https://downloads.openwrt.org/snapshots/targets/arc770/generic/openwrt-sdk-arc770-generic_gcc-8.3.0_uClibc.Linux-x86_64.tar.xz
#- <<: *compile-staging # arc_archs
# if: tag IS present OR env(BUILD_ALL) = 1
# env: SDK_URL=https://downloads.openwrt.org/snapshots/targets/archs38/generic/openwrt-sdk-archs38-generic_gcc-8.3.0_uClibc.Linux-x86_64.tar.xz
- <<: *compile-staging # arm_cortex-a9
if: tag IS present OR env(BUILD_ALL) = 1
env: SDK_URL=https://downloads.openwrt.org/snapshots/targets/bcm53xx/generic/openwrt-sdk-bcm53xx-generic_gcc-8.3.0_musl_eabi.Linux-x86_64.tar.xz
- <<: *compile-staging # arm_cortex-a9_vfpv3
if: tag IS present OR env(BUILD_ALL) = 1
env: SDK_URL=https://downloads.openwrt.org/snapshots/targets/mvebu/cortexa9/openwrt-sdk-mvebu-cortexa9_gcc-8.3.0_musl_eabi.Linux-x86_64.tar.xz
- <<: *compile-staging # arm_arm1176jzf-s_vfp
if: tag IS present OR env(BUILD_ALL) = 1
env: SDK_URL=https://downloads.openwrt.org/snapshots/targets/brcm2708/bcm2708/openwrt-sdk-brcm2708-bcm2708_gcc-8.3.0_musl_eabi.Linux-x86_64.tar.xz
- <<: *compile-staging # arm_cortex-a7_neon-vfpv4
if: tag IS present OR env(BUILD_ALL) = 1
env: SDK_URL=https://downloads.openwrt.org/snapshots/targets/brcm2708/bcm2709/openwrt-sdk-brcm2708-bcm2709_gcc-8.3.0_musl_eabi.Linux-x86_64.tar.xz
- <<: *compile-staging # arm_cortex-a15_neon-vfpv4
if: tag IS present OR env(BUILD_ALL) = 1
env: SDK_URL=https://downloads.openwrt.org/snapshots/targets/ipq806x/generic/openwrt-sdk-ipq806x-generic_gcc-8.3.0_musl_eabi.Linux-x86_64.tar.xz
- <<: *compile-staging # arm_arm926ej-s
if: tag IS present OR env(BUILD_ALL) = 1
env: SDK_URL=https://downloads.openwrt.org/snapshots/targets/at91/legacy/openwrt-sdk-at91-legacy_gcc-7.4.0_musl_eabi.Linux-x86_64.tar.xz
- <<: *compile-staging # arm_cortex-a5_neon-vfpv4
if: tag IS present OR env(BUILD_ALL) = 1
env: SDK_URL=https://downloads.openwrt.org/snapshots/targets/at91/sama5/openwrt-sdk-at91-sama5_gcc-8.3.0_musl_eabi.Linux-x86_64.tar.xz
- <<: *compile-staging # arm_cortex-a8_vfpv3
if: tag IS present OR env(BUILD_ALL) = 1
env: SDK_URL=https://downloads.openwrt.org/snapshots/targets/sunxi/cortexa8/openwrt-sdk-sunxi-cortexa8_gcc-8.3.0_musl_eabi.Linux-x86_64.tar.xz
- <<: *compile-staging # arm_cortex-a9_neon
if: tag IS present OR env(BUILD_ALL) = 1
env: SDK_URL=https://downloads.openwrt.org/snapshots/targets/imx6/generic/openwrt-sdk-imx6_gcc-8.3.0_musl_eabi.Linux-x86_64.tar.xz
- <<: *compile-staging # arm_fa526
if: tag IS present OR env(BUILD_ALL) = 1
env: SDK_URL=https://downloads.openwrt.org/snapshots/targets/gemini/generic/openwrt-sdk-gemini_gcc-8.3.0_musl_eabi.Linux-x86_64.tar.xz
- <<: *compile-staging # arm_mpcore
if: tag IS present OR env(BUILD_ALL) = 1
env: SDK_URL=https://downloads.openwrt.org/snapshots/targets/oxnas/ox820/openwrt-sdk-oxnas-ox820_gcc-8.3.0_musl_eabi.Linux-x86_64.tar.xz
- <<: *compile-staging # arm_mpcore_vfp
if: tag IS present OR env(BUILD_ALL) = 1
env: SDK_URL=https://downloads.openwrt.org/snapshots/targets/cns3xxx/generic/openwrt-sdk-cns3xxx_gcc-8.3.0_musl_eabi.Linux-x86_64.tar.xz
- <<: *compile-staging # arm_xscale
if: tag IS present OR env(BUILD_ALL) = 1
env: SDK_URL=https://downloads.openwrt.org/snapshots/targets/kirkwood/generic/openwrt-sdk-kirkwood_gcc-8.3.0_musl_eabi.Linux-x86_64.tar.xz
#- <<: *compile-staging # armeb_xscale
# if: tag IS present OR env(BUILD_ALL) = 1
# env: SDK_URL=https://downloads.openwrt.org/snapshots/targets/ixp4xx/generic/openwrt-sdk-ixp4xx-generic_gcc-8.3.0_musl.Linux-x86_64.tar.xz
- <<: *compile-staging # mips_24kc
if: tag IS present OR env(BUILD_ALL) = 1
env: SDK_URL=https://downloads.openwrt.org/snapshots/targets/ar71xx/generic/openwrt-sdk-ar71xx-generic_gcc-7.4.0_musl.Linux-x86_64.tar.xz
- <<: *compile-staging # mips_mips32
if: tag IS present OR env(BUILD_ALL) = 1
env: SDK_URL=https://downloads.openwrt.org/snapshots/targets/brcm63xx/generic/openwrt-sdk-brcm63xx-generic_gcc-8.3.0_musl.Linux-x86_64.tar.xz
- <<: *compile-staging # mipsel_24kc
if: tag IS present OR env(BUILD_ALL) = 1
env: SDK_URL=https://downloads.openwrt.org/snapshots/targets/ramips/mt7620/openwrt-sdk-ramips-mt7620_gcc-8.3.0_musl.Linux-x86_64.tar.xz
- <<: *compile-staging # mipsel_24kc_24kf
if: tag IS present OR env(BUILD_ALL) = 1
env: SDK_URL=https://downloads.openwrt.org/snapshots/targets/pistachio/generic/openwrt-sdk-pistachio_gcc-8.3.0_musl.Linux-x86_64.tar.xz
- <<: *compile-staging # mipsel_mips32
if: tag IS present OR env(BUILD_ALL) = 1
env: SDK_URL=https://downloads.openwrt.org/snapshots/targets/brcm47xx/generic/openwrt-sdk-brcm47xx-generic_gcc-8.3.0_musl.Linux-x86_64.tar.xz
- <<: *compile-staging # mipsel_74kc
if: tag IS present OR env(BUILD_ALL) = 1
env: SDK_URL=https://downloads.openwrt.org/snapshots/targets/brcm47xx/mips74k/openwrt-sdk-brcm47xx-mips74k_gcc-8.3.0_musl.Linux-x86_64.tar.xz
#- <<: *compile-staging # powerpc_464fp
# if: tag IS present OR env(BUILD_ALL) = 1
# env: SDK_URL=https://downloads.openwrt.org/snapshots/targets/apm821xx/nand/openwrt-sdk-apm821xx-nand_gcc-8.3.0_musl.Linux-x86_64.tar.xz
#- <<: *compile-staging # powerpc_8540
# if: tag IS present OR env(BUILD_ALL) = 1
# env: SDK_URL=https://downloads.openwrt.org/snapshots/targets/mpc85xx/generic/openwrt-sdk-mpc85xx-generic_gcc-8.3.0_musl.Linux-x86_64.tar.xz
- <<: *compile-staging # mips64_octeonplus
if: tag IS present OR env(BUILD_ALL) = 1
env: SDK_URL=https://downloads.openwrt.org/snapshots/targets/octeon/generic/openwrt-sdk-octeon_gcc-8.3.0_musl.Linux-x86_64.tar.xz
- <<: *compile-staging # mips64_octeon
if: tag IS present OR env(BUILD_ALL) = 1
env: SDK_URL=http://downloads.openwrt.org/releases/18.06.5/targets/octeon/generic/openwrt-sdk-18.06.5-octeon_gcc-7.3.0_musl.Linux-x86_64.tar.xz
- stage: trigger checked
if: tag IS blank
script:
- |
if [ -n "$TRIGGER_URL" ] ; then
curl -X POST \
-H "Content-Type: application/json; charset=utf-8" \
-H "Authorization: Bearer $TRIGGER_TOKEN" \
-d "{\"event\":\"checked\",\"repo_slug\":\"$TRAVIS_REPO_SLUG\",\"branch\":\"$TRAVIS_BRANCH\",\"tag\":\"$TRAVIS_TAG\"}" \
"$TRIGGER_URL" || true
fi
- stage: trigger deploy
if: tag IS present
script:
- |
if [ -n "$TRIGGER_URL" ] ; then
curl -X POST \
-H "Content-Type: application/json; charset=utf-8" \
-H "Authorization: Bearer $TRIGGER_TOKEN" \
-d "{\"event\":\"release\",\"repo_slug\":\"$TRAVIS_REPO_SLUG\",\"branch\":\"$TRAVIS_BRANCH\",\"tag\":\"$TRAVIS_TAG\"}" \
"$TRIGGER_URL" || true
fi