-
Notifications
You must be signed in to change notification settings - Fork 5
/
.travis.yml
88 lines (80 loc) · 3.31 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
language: go
matrix:
include:
- go: 1.x
env: LATEST=true
- go: 1.13.x
- go: 1.12.x
- go: 1.11.x
- go: 1.10.x
- go: tip
allow_failures:
- go: tip
env:
global:
- DEP_VERSION="0.5.0"
branches:
except:
# Don't build Travis CI tags
# MMDDyyyy-shortCommitHash
- /[0-9]{8}-[0-9a-f]{7}/
before_install:
- curl -L -s https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64
-o $GOPATH/bin/dep
- chmod +x $GOPATH/bin/dep
- go get -u github.com/gobuffalo/packr/v2/packr2
install:
- dep ensure -v
- cd $GOPATH/src/github.com/oipwg/oip/cmd/oipd && packr2 -v && cd -
cache:
directories:
- "$GOPATH/pkg/dep"
script:
- go test -v -race ./...
# Only build binaries from the latest Go release.
- if [ "${LATEST}" = "true" ]; then
env GOOS=darwin GOARCH=amd64 go build -ldflags
"-X github.com/oipwg/oip/version.GitCommitHash=$(git rev-parse --short HEAD)
-X github.com/oipwg/oip/version.BuildDate=$(date +'%Y.%m.%d.%H%M%S')
-X github.com/oipwg/oip/version.BuiltBy=TravisCI
-X 'github.com/oipwg/oip/version.GoVersion=$(go version)'
-s -w" -o oipd github.com/oipwg/oip/cmd/oipd &&
tar -czvf oipd.darwin.amd64.tar.gz oipd ;
fi
- if [ "${LATEST}" = "true" ]; then
env GOOS=linux GOARCH=amd64 go build -ldflags
"-X github.com/oipwg/oip/version.GitCommitHash=$(git rev-parse --short HEAD)
-X github.com/oipwg/oip/version.BuildDate=$(date +'%Y.%m.%d.%H%M%S')
-X github.com/oipwg/oip/version.BuiltBy=TravisCI
-X 'github.com/oipwg/oip/version.GoVersion=$(go version)'
-s -w" -o oipd github.com/oipwg/oip/cmd/oipd &&
tar -czvf oipd.linux.amd64.tar.gz oipd ;
fi
- if [ "${LATEST}" = "true" ]; then
env GOOS=windows GOARCH=amd64 go build -ldflags
"-X github.com/oipwg/oip/version.GitCommitHash=$(git rev-parse --short HEAD)
-X github.com/oipwg/oip/version.BuildDate=$(date +'%Y.%m.%d.%H%M%S')
-X github.com/oipwg/oip/version.BuiltBy=TravisCI
-X 'github.com/oipwg/oip/version.GoVersion=$(go version)'
-s -w" -o oipd.exe github.com/oipwg/oip/cmd/oipd &&
zip oipd.windows.amd64.zip oipd.exe ;
fi
before_deploy:
- git config --local user.name "Jenny Ruok"
- git config --local user.email "[email protected]"
- git tag -a "$(date +'%Y%m%d')-$(git rev-parse --short HEAD)" -m "tagged by Travis-CI"
deploy:
provider: releases
skip_cleanup: true
target_commitish: $TRAVIS_COMMIT
api_key:
secure: Lu295zM6k2P8Nxp0knMY/N3NzN7d7uOeEjna/ut8fArBzwz8lXdGJatZAOPbsU3V/lM6SP+RPCtibo8L+dKfISSrmx/Q0Q5GMxI7Tiuhj3sD73NgYRk0pB0lSVK7mzpLOxtV0yNKZgph92cUkF617yt0I84xm5AwAQNVqUHRdFJzECi3a2RTc5/heh7710QRYKzpNNS8YAF093n9zdctdwNBJaQoVpiJi9qaoflq4BN8fu1QwkxQh2Ba+QXIMynM3f3ywOD/zlgdM3QzOCYV93yCMDJWEWgrrCVTas8LC0BdYChf850FxRZ2Xe8n+VAJ4hUIl7KBrX6K0MKX6idd5j3xRndPF5jkMMhlZbowwshdFtemtNXr7YiWwuiD5+JG34tMOKWmFWCi2V3VAFnCxBFcC0EKNwVFNRVm2SOpAEZPW7QhqWw1M1iz+d0UG713jJAHexW1dnJkhr1S5emm3WvlOcB0cRl1dnjxs+9d4fgOWBbHUZcgYljiyiqVV0pOJg7/Obn60PP7loKwQN8H2VsOxJifX8K1NfL72e48YHUubxD0m4kf/ZQsYcdn+YfQ1GMS6RkirW/R1f32StugNW0QLoLqoJq4IymtccQHpAI7vmQ6K84ZQJaLY3Q/yHZ6gpl+nH/qXyzvilNJj6A8fKmBzG9B/vBjKzjZAkBbh3k=
file:
- oipd.darwin.amd64.tar.gz
- oipd.linux.amd64.tar.gz
- oipd.windows.amd64.zip
prerelease: true
on:
branch: build
repo: oipwg/oip
condition: $LATEST = true