Skip to content

Commit

Permalink
add travis.yml for auto build
Browse files Browse the repository at this point in the history
  • Loading branch information
lonord committed Mar 7, 2020
1 parent 28e3648 commit 03161d9
Showing 1 changed file with 85 additions and 0 deletions.
85 changes: 85 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
dist: trusty
sudo: false
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
- xsltproc
- zip
env:
global:
- PACKAGE=luci-app-ss-domain-rule
- GITHUB_USER=lonord
- GITHUB_REPO=luci-app-ss-domain-rule
- DOWNLOAD_DIR=${HOME}/files
- SDK_PATH=https://downloads.openwrt.org/releases/18.06.4/targets/x86/64
- SDK=-sdk-18.06.4-x86-64_
install:
- mkdir -p "$HOME/files" && cd "$HOME/files"
- 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 "$HOME/files/$SDK_FILE"
- export SDK_HOME="$(mktemp -d)"
- cd "$SDK_HOME"
- tar -Jxf "$HOME/files/$SDK_FILE" --strip=1
- test -d "$HOME/dl" || mkdir -p "$HOME/dl"
- 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"
script:
- cd "$SDK_HOME"
- "./scripts/feeds update -a >/dev/null"
- "./scripts/feeds install -a >/dev/null"
- make defconfig
- make package/$PACKAGE/{clean,compile} V=s
- find "$SDK_HOME/bin/"
- find "$SDK_HOME/bin/" -name luci-*-ss-domain-rule*.ipk -exec cp {} "$TRAVIS_BUILD_DIR"
\;
- ls -hl "$TRAVIS_BUILD_DIR" | grep .*\.ipk
deploy:
provider: releases
file_glob: true
file: "$TRAVIS_BUILD_DIR/*.ipk"
skip_cleanup: true
on:
tags: true
api_key:
secure: AGcREbuejBoTg3wsPnQwosQgF1SDcuIx7UVE/j5O6Gahl4pNrYPSmDnCbvAVZfhJma1Jiy7dwXnVnM4FO8GpAgHZqs/J/+9ELxCB66Nf2wUlhkK2R1NUY4P23DR8ysICL8S8EatSNaWlhJwmyJEaPuAnXb9vB/IGIpdCmAkuKkPKnRLOHqKbyTshxP5jgMtDEtEYVU/kvi5DSB7meWSnccghKwLxwwGcDWWsOmNBBnIRVqKM09bvPur8pbQ4fc03/14lll2jo/ruu6Ae9NIrUAMGk2CEnbS4PiaLhe+55hplOFz4hmCEI9tiVkwj6Z5BlwE38ZDq7AsG2mqCvNPmwrJ6Vo0SnFKMyONDeQSAUVdm+QFXrBGhUUV3rioHpGI6fEr03lx60Wd1Go6ivcmjNVHVvU2Vn/LDGYuXLLxghE/6bi/d9WkRNi8GQAjtYngthyfyMVVnZQBpCN/4f5gu5KYdMd2lgBvFLFX/Td0yfWCmXJGQv3h9hxaQifmCCSXat8MDOuIyJgsiumRC7YJaqM9nwj2F4BZ+jlZXE61LyInU6kh4/KUvquIhQZr40HBAA6XWxL7nSVd9uUFSX455UhClAbLPef+shLOBkUQZLOEvNph8wqYaXyMGCrkDq3/v/UMDbj/cFJrIQSYKXMlq6momm2Clv1GG2mq7FCoy9Ro=

0 comments on commit 03161d9

Please sign in to comment.