forked from wandera/s3syncer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
60 lines (54 loc) · 2.06 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
language: go
go:
- 1.11.5
- master
matrix:
# It's ok if our code fails on unstable development versions of Go.
allow_failures:
- go: master
# Don't wait for tip tests to finish. Mark the test run green if the
# tests pass on the stable versions of Go.
fast_finish: true
cache:
directories:
- $GOPATH/pkg
env:
- GO111MODULE=on
script:
- go test -v ./...
- go vet -v ./...
before_deploy:
- PLATFORMS=(darwin/amd64 freebsd/amd64 linux/amd64 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 s3syncer -ldflags '-w -s'"
else
build_cmd="CGO_ENABLED=0 GOOS=$GOOS GOARCH=$GOARCH go build -o s3syncer -ldflags '-w -s'"
fi
if ! eval $build_cmd; then
echo "Failed building sample for $PLATFORM" && return 1
fi
if [ "$GOOS" = "windows" ]; then
zip s3syncer-${GOOS}-${GOARCH}.zip s3syncer
else
tar cvzf s3syncer-${GOOS}-${GOARCH}.tgz s3syncer
fi
done
- ls
deploy:
provider: releases
api_key:
secure: gtT3CT0Rh4nEyczo3bpWEsTsoXh272UmLY8eTI/3uGUItPpdQwP3fTsz2dhGB397FalzNuWlCwexo4l7Ky/euftA9/eOdbHW2SDe2dBLp6GqshXhFgXIhtJ8iU6JPFIsToTxGQb8/VVqse8Bl1Z/deuMwlkZyPMd+Mjv/Kf1wRwmGtbjexwZwzawVTyad1B0XYNuCaZo0SnNpjt4iCI5ikTMkJ0V+nd7qxeBK+fvOJTyel43W4eoltZZfkqXe4abiCfE8lFrrBjePUNPy+RzzFAY7RsM1JsBLID/Xn/6gJz1ppC1u4SyU6K5Wy1CK/O1hsmuXfc2QRRqZ+q6/XItil0Qq3OKikEnzSMhldTzEkvv7zK6rO0OvnzQX8/LjUt1nOr+F3NILoJUwSVuPNfZ4RGGVRSlyGM2cCTrVK6Lcqc28jyrJeyZznbVEr+Gcezbnlh70Jvh8f8ov9xWmSGsTBq2kxt/EIsqi8rp2yxzSLBx+FHC771xm4pQc6OP0FiMiTJvcI29EazM3vN345sH14r1zYcK4jWAhXKjdFh1OGIF4b5ZyhiePAh2u09MEJzsAH7wyjxiZzGweGDZdhf4HGrR4F5TG0rkJEIaWJKYx5ALBpGfSUkEwqQBvxFWk9z43oUkyH4neRa+SjZQkk63HrHfmlvsG9QecEGxvPXhHRg=
file:
- "s3syncer-darwin-amd64.tgz"
- "s3syncer-freebsd-amd64.tgz"
- "s3syncer-linux-amd64.tgz"
- "s3syncer-windows-amd64.zip"
skip_cleanup: true
on:
tags: true