-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
57 lines (49 loc) · 1.21 KB
/
Taskfile.yml
File metadata and controls
57 lines (49 loc) · 1.21 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
version: 3
vars:
name: "fwatcher"
tasks:
dev:
cmds:
- go run ./cmd
build:
requires:
vars:
- version
vars:
upx: '{{.upx | default "false"}}'
binary: '{{.binary | default .name }}'
date_str:
sh: "date '+%T %p (%Z) | %a %b %d, %Y'"
version_str: "[{{.version }}] built at {{.date_str}}"
env:
GOOS: '{{ .GOOS }}'
GOARCH: '{{ .GOARCH }}'
cmds:
- echo "building binary for ${GOOS:-$(go env GOOS)} (${GOARCH:-$(go env GOARCH)})"
- echo version str "{{.version_str}}"
- go build -ldflags '-s -w -X "main.Version={{.version_str}}"' -o ./bin/{{.binary}} ./cmd
- |+
if [[ "{{.upx}}" = "true" ]]; then
upx ./bin/{{.binary}}
fi
test:executor:
cmds:
- go test -json ./pkg/executor/... | gotestfmt
test:watcher:
env:
DEBUG: false
cmds:
- go test -json ./pkg/watcher/... | gotestfmt
build:dev:
cmds:
- go build -o ./bin/fwatcher ./cmd
example:http-server:
cmds:
- |+
go run ./examples/http-server/main.go
install:
cmds:
- task: build
vars:
version: dev
- ln -sf $PWD/bin/{{.name}} $HOME/.local/bin/{{.name}}