-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.travis.yml
79 lines (76 loc) · 2.42 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
language: go
os: linux
dist: xenial
stages:
- test
- build
- deploy
jobs:
include:
- go: tip
os: linux
stage: test
- go: 1.13.x
os: linux
stage: test
- go: 1.14.x
os: linux
stage: test
- go: 1.x
os: osx
stage: build
before_install:
- HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1 brew install awscli
- mkdir -p ~/$TRAVIS_BUILD_NUMBER
- aws s3 sync s3://$AWS_BUCKET/$TRAVIS_BUILD_NUMBER ~/$TRAVIS_BUILD_NUMBER
- go get github.com/mitchellh/gox
script:
- CGO_ENABLED=1 gox -os="darwin" -arch="amd64" -output="sounddrop.{{.OS}}.{{.Arch}}" -ldflags "-X main.rev=`git rev-parse --short HEAD`" -verbose ./...
after_success:
- cp sounddrop.darwin.amd64 ~/$TRAVIS_BUILD_NUMBER
- aws s3 sync ~/$TRAVIS_BUILD_NUMBER s3://$AWS_BUCKET/$TRAVIS_BUILD_NUMBER
- go: 1.x
os: linux
stage: build
before_install:
- pyenv global 3.7.1
- pip install -U pip
- pip install awscli
- mkdir -p ~/$TRAVIS_BUILD_NUMBER
- aws s3 sync s3://$AWS_BUCKET/$TRAVIS_BUILD_NUMBER ~/$TRAVIS_BUILD_NUMBER
- go get github.com/konsorten/go-windows-terminal-sequences # For windows build
- go get github.com/mitchellh/gox
- sudo apt update && sudo apt install -y libasound2-dev
script:
- CGO_ENABLED=1 gox -os="linux windows" -arch="amd64" -output="sounddrop.{{.OS}}.{{.Arch}}" -ldflags "-X main.rev=`git rev-parse --short HEAD`" -verbose ./...
after_success:
- cp sounddrop.linux.amd64 ~/$TRAVIS_BUILD_NUMBER
- cp sounddrop.windows.amd64.exe ~/$TRAVIS_BUILD_NUMBER
- aws s3 sync ~/$TRAVIS_BUILD_NUMBER s3://$AWS_BUCKET/$TRAVIS_BUILD_NUMBER
- stage: deploy
before_install:
- pyenv global 3.7.1
- pip install -U pip
- pip install awscli
- mkdir build
- aws s3 sync s3://$AWS_BUCKET/$TRAVIS_BUILD_NUMBER ./build
install: skip
script: skip
deploy:
provider: releases
edge: true
draft: true
token: $GITHUB_TOKEN
file:
- ./build/*
on:
repo: tuarrep/sounddrop
tags: true
allow_failures:
- go: tip
before_install:
- sudo apt update && sudo apt install -y libasound2-dev
script:
- diff -u <(echo -n) <(gofmt -d .)
- go vet $(go list ./... | grep -v /vendor/)
- go test -v -race ./...