-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
62 lines (55 loc) · 1.45 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
language: go
go:
- "1.11.x"
- master
os:
- linux
- osx
dist: trusty
install: true
script:
- env GO111MODULE=on go build
- env GO111MODULE=on go test
- go get -t -v ./...
- go vet $(go list ./... | grep -v /vendor/)
- go test -v -race ./...
before_deploy:
- PLATFORMS=(darwin/386 darwin/amd64 freebsd/386 freebsd/amd64 freebsd/arm linux/386 linux/amd64 linux/arm windows/386 windows/amd64)
# build binary for all archs
- |
for PLATFORM in "${PLATFORMS[@]}"; do
echo "Building $PLATFORM"
GOOS=${PLATFORM%/*}
GOARCH=${PLATFORM#*/}
if [ "$GOOS" = "windows" ]; then
build_cmd="GOOS=$GOOS GOARCH=$GOARCH go build -o tiki -ldflags '-w -s'"
else
build_cmd="CGO_ENABLED=0 GOOS=$GOOS GOARCH=$GOARCH go build -o tiki -ldflags '-d -w -s'"
fi
if ! eval $build_cmd; then
echo "Failed building tiki for $PLATFORM" && return 1
fi
if [ "$GOOS" = "windows" ]; then
zip tiki-${GOOS}-${GOARCH}.zip tiki
else
tar cvzf tiki-${GOOS}-${GOARCH}.tgz tiki
fi
done
- ls
deploy:
provider: releases
api_key: $AUTH_TOKEN
file:
- "tiki-darwin-386.tgz"
- "tiki-darwin-amd64.tgz"
- "tiki-freebsd-386.tgz"
- "tiki-freebsd-arm.tgz"
- "tiki-freebsd-amd64.tgz"
- "tiki-linux-386.tgz"
- "tiki-linux-arm.tgz"
- "tiki-linux-amd64.tgz"
- "tiki-windows-386.zip"
- "tiki-windows-amd64.zip"
skip_cleanup: true
on:
tags: true