-
Notifications
You must be signed in to change notification settings - Fork 29
/
.travis.yml
112 lines (112 loc) · 4.33 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
dist: bionic
os: linux
notifications:
email: false
language: c
compiler: gcc
cache:
bundler: true
ccache: true
directories:
- ${HOME}/dl
- ${HOME}/files
- ${HOME}/feeds
git:
depth: 3
submodules: false
env:
global:
- PACKAGE=kcptun
- DOWNLOAD_DIR=${HOME}/files
- CONFIG_CCACHE=y
matrix:
include:
- env: SDK_PATH=https://downloads.openwrt.org/snapshots/targets/x86/64 SDK=-sdk-x86-64_
- if: tag IS present
env: SDK_PATH=https://downloads.openwrt.org/snapshots/targets/x86/generic SDK=-sdk-x86-generic_
- if: tag IS present
env: SDK_PATH=https://downloads.openwrt.org/snapshots/targets/ar71xx/generic SDK=-sdk-ar71xx-generic_
- if: tag IS present
env: SDK_PATH=https://downloads.openwrt.org/snapshots/targets/ramips/mt7620 SDK=-sdk-ramips-mt7620_
- if: tag IS present
env: SDK_PATH=https://downloads.openwrt.org/snapshots/targets/brcm2708/bcm2709 SDK=-sdk-brcm2708-bcm2709_
- if: tag IS present
env: SDK_PATH=https://downloads.openwrt.org/snapshots/targets/brcm2708/bcm2710 SDK=-sdk-brcm2708-bcm2710_
- if: tag IS present
env: SDK_PATH=https://downloads.openwrt.org/snapshots/targets/brcm63xx/generic SDK=-sdk-brcm63xx-generic_
- if: tag IS present
env: SDK_PATH=https://downloads.openwrt.org/snapshots/targets/bcm53xx/generic SDK=-sdk-bcm53xx-generic_
- if: tag IS present
env: SDK_PATH=https://downloads.openwrt.org/snapshots/targets/brcm47xx/generic SDK=-sdk-brcm47xx-generic_
- if: tag IS present
env: SDK_PATH=https://downloads.openwrt.org/snapshots/targets/mvebu/cortexa9 SDK=-sdk-mvebu-cortexa9_
- if: tag IS present
env: SDK_PATH=https://downloads.openwrt.org/snapshots/targets/mvebu/cortexa72 SDK=-sdk-mvebu-cortexa72_
- if: tag IS present
env: SDK_PATH=https://downloads.openwrt.org/snapshots/targets/ipq806x/generic SDK=-sdk-ipq806x-generic_
- if: tag IS present
env: SDK_URL=http://downloads.openwrt.org/snapshots/targets/layerscape/armv8_64b SDK=-sdk-layerscape-armv8_64b_
before_install:
- test -d "$DOWNLOAD_DIR" || mkdir -p "$DOWNLOAD_DIR"
- cd "$DOWNLOAD_DIR"
- wget "${SDK_PATH}/sha256sums" -O sha256sums
- |
if ! grep -- "$SDK" sha256sums > sha256sums.small 2>/dev/null ; then
printf "\033[1;31m=== Can not find ${SDK} file in sha256sums.\033[m\n"
exit 1
fi
- export SDK_FILE="$(cat sha256sums.small | cut -d' ' -f2 | sed 's/*//g')"
- |
if ! sha256sum -c ./sha256sums.small 2>/dev/null ; then
wget "${SDK_PATH}/${SDK_FILE}" -O "$SDK_FILE"
if ! sha256sum -c ./sha256sums.small 2>/dev/null ; then
printf "\033[1;31m=== SDK can not be verified!\033[m\n"
exit 1
fi
fi
- file "${DOWNLOAD_DIR}/${SDK_FILE}"
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_FILE}" -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
- echo "src-git base https://github.com/openwrt/openwrt.git" >feeds.conf
- echo "src-git packages https://github.com/openwrt/packages.git" >>feeds.conf
- echo "src-git luci https://github.com/openwrt/luci.git" >>feeds.conf
- echo "src-git routing https://git.openwrt.org/feed/routing.git" >>feeds.conf
- echo "src-git telephony https://github.com/openwrt/telephony.git" >>feeds.conf
- ln -s "$TRAVIS_BUILD_DIR" "package/${PACKAGE}"
before_script:
- cd "$SDK_HOME"
- ./scripts/feeds update -a
- |
test -d ./feeds/packages/net/kcptun && \
rm -rf ./feeds/package/net/kcptun || true
- |
curl https://codeload.github.com/openwrt/packages/tar.gz/${OPENWRT_GOLANG_COMMIT:-master} | \
tar -xz -C ./feeds/packages/lang --strip=2 packages-${OPENWRT_GOLANG_COMMIT:-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/"
before_deploy:
- find "${SDK_HOME}/bin/" -name ${PACKAGE}-*.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
token: $GITHUB_TOKEN
on:
tags: true
all_branches: true