forked from rekby/lets-proxy2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
57 lines (47 loc) · 1.6 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
language: go
addons:
apt:
packages:
- dos2unix
go:
- "1.10"
- "1.14"
env:
global:
- COVERALLS_PARALLEL=true
services:
- docker
install:
- test -n "$TRAVIS_TAG" || bash tests/prepare.sh
script:
- test -n "$TRAVIS_TAG" || go test -v -covermode=count -coverprofile=coverage.out ./...
after_script:
# Install and upload test coverage must not failure for test build
- test -n "$TRAVIS_TAG" || go get golang.org/x/tools/cmd/cover
- test -n "$TRAVIS_TAG" || go get github.com/mattn/goveralls
- test -n "$TRAVIS_TAG" || goveralls -coverprofile=coverage.out -service=travis-ci -repotoken $COVERALLS_TOKEN
before_deploy:
- git config --local user.name "$GIT_NAME"
- git config --local user.email "$GIT_EMAIL"
- BUILD_TIME=$(TZ=UTC date --rfc-3339=seconds)
- go get github.com/mitchellh/gox
- mkdir -p output
- GO_VERSION=$(go version)
- echo ${GO_VERSION}
- OS_ARCH_BUILDS="darwin/amd64 linux/386 linux/amd64 linux/arm freebsd/386 freebsd/amd64 freebsd/arm windows/386 windows/amd64"
- GO111MODULE=on CGO_ENABLED=0 gox --mod=vendor -osarch "$OS_ARCH_BUILDS" --ldflags "-X \"main.VERSION=$TRAVIS_TAG+build-$TRAVIS_BUILD_NUMBER, Build time $BUILD_TIME, commit $TRAVIS_COMMIT, $GO_VERSION\"" --output="output/lets-proxy_{{.OS}}_{{.Arch}}" -verbose --rebuild ./cmd/
- bash tests/make_archives.sh
deploy:
skip_cleanup: true
provider: releases
on:
repo: rekby/lets-proxy2
tags: true
api_key: $GITHUB_TOKEN
file_glob: true
file: output/*
notifications:
webhooks:
urls:
- https://coveralls.io/webhook?repo_token=$COVERALLS_TOKEN
if: env(tags) IS blank