-
Notifications
You must be signed in to change notification settings - Fork 9
/
Taskfile.yml
52 lines (49 loc) · 1.33 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
# github.com/go-task/task
version: '3'
vars:
BINARY_NAME: kubemqctl
VERSION: v3.7.2
tasks:
check_update:
cmds:
- go list -u -m -json -mod=mod all | go-mod-outdated -update -direct
lint:
cmds:
- golangci-lint run --disable gocritic --enable misspell --enable gosec
build:
cmds:
- go build -o {{.BINARY_NAME}}.exe -ldflags "-X main.version={{.VERSION}}"
default:
cmds:
- go mod tidy
- go mod vendor
# - golangci-lint run -E misspell,gosec
- task: build_win
- task: build_mac
- task: build_linux_64
- task: build_linux_32
build_win:
env:
GOOS: windows
GOARCH: amd64
cmds:
- go build -o "{{.BINARY_NAME}}.exe" -ldflags "-X main.version={{.VERSION}}"
- go build -o "./bin/{{.BINARY_NAME}}.exe" -ldflags "-X main.version={{.VERSION}}"
build_mac:
env:
GOOS: darwin
GOARCH: amd64
cmds:
- go build -o "./bin/{{.BINARY_NAME}}_darwin_amd64" -ldflags "-X main.version={{.VERSION}}"
build_linux_64:
env:
GOOS: linux
GOARCH: amd64
cmds:
- go build -o "./bin/{{.BINARY_NAME}}_linux_amd64" -ldflags "-X main.version={{.VERSION}}"
build_linux_32:
env:
GOOS: linux
GOARCH: 386
cmds:
- go build -o "./bin/{{.BINARY_NAME}}_linux_386" -ldflags "-X main.version={{.VERSION}}"