-
Notifications
You must be signed in to change notification settings - Fork 1
/
Taskfile.yml
87 lines (75 loc) · 1.59 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
version: '3'
vars:
ext: '{{if eq OS "windows"}}.exe{{end}}'
test_binaries: |
test/sleep
env:
CGO_ENABLED: 0
tasks:
default:
deps:
- all
all:
desc: 'Build and test everything'
deps:
- build
- test
build:
desc: 'Build all components'
deps:
- build_binaries
build_binaries:
desc: 'Build all necessary binaries'
deps:
- build_memsparkline
- build_test_binaries
build_binary:
desc: 'Build a single Go binary'
internal: true
cmds:
- go build -o {{.out | shellQuote}}{{.ext}} {{.src | shellQuote}}
build_memsparkline:
desc: 'Build the memsparkline binary'
cmds:
- task: build_binary
vars:
out: memsparkline
src: main.go
sources:
- main.go
generates:
- memsparkline{{.ext}}
build_test_binaries:
desc: 'Build the test binaries'
cmds:
- task: build_binary
vars:
src: '{{.test_binary}}.go'
out: '{{.test_binary}}'
for:
var: test_binaries
as: test_binary
sources:
- test/sleep.go
generates:
- test/sleep{{.ext}}
clean:
desc: 'Clean up binaries'
cmds:
- rm -f memsparkline{{.ext}}
- cmd: rm -f {{.test_binary | shellQuote}}{{.ext}}
for:
var: test_binaries
as: test_binary
release:
desc: 'Prepare a release'
deps:
- build_binaries
cmds:
- VERSION=$(./memsparkline{{.ext}} --version) go run script/release.go
test:
desc: 'Run tests'
deps:
- build_binaries
cmds:
- go test