-
-
Notifications
You must be signed in to change notification settings - Fork 43
/
Taskfile.yml
65 lines (55 loc) · 1.21 KB
/
Taskfile.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
version: "3"
vars:
PROGRAM: stunner
env:
CGO_ENABLED: 0
tasks:
update:
cmds:
- go get -u
- go mod tidy -v
build:
aliases: [default]
cmds:
- go fmt ./...
- go vet ./...
- go build -o {{.OUTPUT_FILE | default .PROGRAM}}
env:
GOOS: '{{.GOOS | default "linux"}}'
GOARCH: '{{.GOARCH | default "amd64"}}'
linux:
cmds:
- task: build
vars:
GOOS: linux
GOARCH: amd64
windows:
cmds:
- task: build
vars:
OUTPUT_FILE: "{{.PROGRAM}}.exe"
GOOS: windows
GOARCH: amd64
test:
env:
CGO_ENABLED: 1 # required by -race
cmds:
- go test -race -cover ./...
lint:
cmds:
- golangci-lint run ./... --timeout=30m
- go mod tidy
lint-update:
cmds:
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b {{ .GOPATH }}/bin
- golangci-lint --version
vars:
GOPATH:
sh: go env GOPATH
tag:
cmds:
- git tag -a "${TAG}" -m "${TAG}"
- git push origin "${TAG}"
preconditions:
- sh: '[[ -n "${TAG}" ]]'
msg: "Please set the TAG environment variable"