-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.travis.yml
81 lines (72 loc) · 2.78 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
language: go
go:
- 1.12.x
services:
- docker
env:
global:
- CGO_ENABLED=0
- GO111MODULE=on
- GOPROXY=https://proxy.golang.org
cache:
directories:
- "$GOPATH/pkg/mod"
- "$GOPATH/bin"
install: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.16.0
script:
- go test -v -coverprofile=coverage.txt ./...
- golangci-lint -v run
- |
set -e
for dist in linux/386 linux/amd64 windows/amd64 darwin/amd64
do
os=`echo $dist | cut -d'/' -f1`
arch=`echo $dist | cut -d'/' -f2`
env GOOS=$os GOARCH=$arch go build -o bin/notifr_${os}_${arch} -ldflags "-w -s -X main.version=$TRAVIS_TAG" ./cmd/notifr
if [[ "$os" = "windows" ]]; then
zip -r bin/notifr_${os}_${arch}.zip bin/notifr_${os}_${arch}
else
tar cvzf bin/notifr_${os}_${arch}.tar.gz bin/notifr_${os}_${arch}
fi
done
(cd bin && sha256sum *.{tar.gz,zip} > notifr_checksums.txt)
- |
set -e
docker build --build-arg GOPROXY --build-arg VERSION=$TRAVIS_TAG -t "icoreru/notifr:$TRAVIS_COMMIT" .
if [ -n "$TRAVIS_TAG" ]; then
docker tag "icoreru/notifr:$TRAVIS_COMMIT" "icoreru/notifr:$TRAVIS_TAG"
docker tag "icoreru/notifr:$TRAVIS_COMMIT" "icoreru/notifr:latest"
fi
after_success:
- bash <(curl -s https://codecov.io/bash)
before_deploy:
- |
if [ -n "$TRAVIS_TAG" ]; then
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
fi
deploy:
- provider: releases
api_key:
secure: ps48mXLjA5G9nJm5r+riaI3eMt7ZmJAGJ2fhf5XeAvrjHXey/GioH1b7c+GrszZmiWqzBPXsn6rvk/qZ/di8p6WAJ8Tlp2ft/wx1u2Q9OOdN+Tw/iowMExAbOCeYkIBDzHr73c2G8QK8WdZZcG7JYaaOU5VI0yrFuasfnJUmZ9noyQe7A5WM11jgvFMop5dzCcaag5Geaw95xJKzeQMqD9SD36lBVbybIBq3Fzfc1KBqTQSUXv4X3F6VDc4GWE6HxiPEdgN5kZMtm5GmVNpAYdloNixXxLo7fI12L6wSPGmy/gMTNEtEgcaHZ0q87AwdFdUe+GMjn46CmWpyVSxvkbLztFq3e2kyCFo65KVYtFAx80ulb2b29E8URx2u84RLL/AGUw1CdKTPAS1J5A5ZoP7sNzgBK+EEg8s1UZh894dlyJ7GXPCf2oOAUIUguyeRJhWL09wvi+dQe4f/85rOCOyc4mWDgjFtsg2jkFGpvALkOFLfZivANsbZsz9gPMj31u+6h36DOj4UQEfcVloZx37KmDRz+3wLrWha8/hJhJCncf4HV9UPVSRukcZmui56py9duXeoAnLpRr1w0ZHDJQQqxA6WN0yeU6b+1I+MlV/6WW7zPng05aoLWFw+WGsBD9OIWLdLf+gcx38tT05mu26DTQ3rOVHMx7LKym7LxUc=
file:
- bin/notifr_linux_386.tar.gz
- bin/notifr_linux_amd64.tar.gz
- bin/notifr_windows_amd64.zip
- bin/notifr_darwin_amd64.tar.gz
- bin/notifr_checksums.txt
skip_cleanup: true
on:
tags: true
condition: $TRAVIS_OS_NAME = linux
- provider: script
skip_cleanup: true
script: docker push "icoreru/notifr:$TRAVIS_TAG"
on:
tags: true
condition: $TRAVIS_OS_NAME = linux
- provider: script
skip_cleanup: true
script: docker push "icoreru/notifr:latest"
on:
tags: true
condition: $TRAVIS_OS_NAME = linux