-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
36 lines (36 loc) · 1.96 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
language: go
go:
- "1.13.x"
dist: bionic
before_install:
- sudo apt-get install gcc-8-arm-linux-gnueabihf libc6-dev-armhf-cross gcc-8-multilib-arm-linux-gnueabihf
- wget https://github.com/upx/upx/releases/download/v3.94/upx-3.94-amd64_linux.tar.xz
- tar -xvf upx-3.94-amd64_linux.tar.xz
- sudo mv upx-3.94-amd64_linux/upx /usr/local/bin
env:
- GO111MODULE=on
cache:
directories:
- $HOME/.cache/go-build
- $HOME/gopath/pkg/mod
script:
- COMMIT=`git rev-parse HEAD`
- VERSION=`git describe --abbrev=0 --tags`
- VAR="-X github.com/godwhoa/oodle/oodle.Commit=${COMMIT} -X github.com/godwhoa/oodle/oodle.Version=${VERSION}"
- echo $VAR
- GOOS=linux go build -o oodle_linux -a -tags netgo -ldflags "$VAR -s -w -extldflags -static"
- GOOS=linux GOARCH=arm GOARM=7 CC=arm-linux-gnueabihf-gcc-8 CGO_ENABLED=1 go build -o oodle_linux_armv7 -a -tags netgo -ldflags "$VAR -s -w -linkmode external -extldflags -static"
- upx --best oodle_linux
- tar -cvzf oodle_$VERSION_x86_64.tar.gz oodle_linux scripts/keepalive config.toml
- tar -cvzf oodle_$VERSION_arm7.tar.gz oodle_linux_armv7 scripts/keepalive config.toml
deploy:
provider: releases
api_key:
secure: "UjxJ+1yfeJc0wUx7jGLdLKBj/O73FKqaB8B4zuk722H0iODkPMsXpaYBOg4hPq8xgqQd/p//ejacsl9VoDkp74EhLdPRQ9C5XJ8RFqtPdSrTLH7Q2K5ODbI3T82gfGd8+xPg89oknUbCKdXjzM60zq4P/T2XRlunSsYnQJkgAoTSHsoooCYcifIqlDK/eOdLSJ0Nsny+pF+qc1AsKwck5C91ta4baituQ9bV+7K3gRFx9i4yaM+3dpUxSngBLi62J1BhnwpDTVcBXCS+hYd/US8m5+ab2lSzZijO/i9mNCSfnvC+2aFrGinjNGF4duCiokFfc14zW088HD0gksbq380QhWYdZW7+8lnb3sQBsee7HV7v/BI8J5sGgQQlQXBH1unQhpdcUJ5ni2kgZl52EUzv51mV0y2qIAFya+4253XsT3cu7NQHV9tGtLlkUdeTe42iS5V7HwCgnvOkxE3f8+5m+DIEz74961U33V+yWdt3+X7/NFDU5K8b0j59tYJFjTTH5tuTJsZKN2hcUjWpZqjo4OLXYBPyeMKVtX9xzKn8o9zhdNEeTndlGxURKiQJC1DJfYyAO/uuXe6w+8x0UCiDAiuZ8yUgsTZS11wmTPJRK8jmEq//kwGg9McDhof4L9fgyL5CFFy25e3S2IOc3c6xQzUXRwpj+Fw7UdDYE5c="
file:
- "oodle_linux_armv7"
- "oodle_linux"
- oodle_$VERSION.tar.gz
skip_cleanup: true
on:
tags: true