-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
74 lines (64 loc) · 1.53 KB
/
Taskfile.yml
File metadata and controls
74 lines (64 loc) · 1.53 KB
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
version: '3'
vars:
os: "{{OS}}"
arch: '{{ternary "arm64" ARCH (eq ARCH "arm")}}'
dist_dir: dist
bin_name: teleconnect
install_dir: '{{default ("$HOME/go/bin") .INSTALL_DIR}}'
tasks:
test:
desc: Run unit tests
cmds:
- go test -v ./...
_build:
cmds:
- go build -o "{{.dist_dir}}/$GOOS-$GOARCH/{{.bin_name}}" cmd/{{.bin_name}}/main.go
env:
GOOS: "{{.targetOS}}"
GOARCH: "{{.targetArch}}"
build:dev:
desc: Build binary for current platform
cmds:
- task: _build
vars:
targetOS: "{{.os}}"
targetArch: "{{.arch}}"
build:dist:
desc: Build binaries for all platforms
deps:
- build:dist:linux:amd64
- build:dist:linux:arm64
- build:dist:darwin:amd64
- build:dist:darwin:arm64
build:dist:linux:amd64:
desc: Build binary for linux/amd64
cmds:
- task: _build
vars:
targetOS: linux
targetArch: amd64
build:dist:linux:arm64:
desc: Build binary for linux/arm64
cmds:
- task: _build
vars:
targetOS: linux
targetArch: arm64
build:dist:darwin:amd64:
desc: Build binary for darwin/amd64
cmds:
- task: _build
vars:
targetOS: darwin
targetArch: amd64
build:dist:darwin:arm64:
desc: Build binary for darwin/arm64
cmds:
- task: _build
vars:
targetOS: darwin
targetArch: arm64
clean:
desc: Clean build artifacts
cmds:
- rm -rf {{.dist_dir}}