-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathTaskfile.yml
69 lines (57 loc) · 1.2 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
# https://taskfile.dev
version: "3"
interval: 200ms
vars:
NAME: "realworld"
BIN_NAME: "{{.NAME}}_bin"
VERSION: "v0.0.1"
tasks:
tools:
cmds:
- go install github.com/go-task/task/v3/cmd/task@latest
- go install github.com/a-h/templ/cmd/templ@latest
- go install github.com/delaneyj/toolbelt/sqlc-gen-zombiezen@latest
- go install golang.org/x/tools/cmd/goimports@latest
sqlc:
dir: sql
sources:
- "**/*.sql"
cmds:
- sqlc generate
- goimports -w .
templ:
env:
TEMPL_EXPERIMENT: rawgo
generates:
- "**/*_templ.go"
sources:
- "**/*.templ"
cmds:
- templ generate .
kill:
cmds:
- killall -q {{.BIN_NAME}} || echo "Process was not running."
hot:
env:
ENV: dev
sources:
- "**/*.go"
- "web/static/**/*"
deps:
- kill
- sqlc
- templ
# - inspector
# - css
cmds:
- go mod tidy
- go build -o ./{{.BIN_NAME}} cmd/{{.NAME}}/main.go
- ./{{.BIN_NAME}}
upx:
cmds:
- go build -ldflags="-s" -o ./{{.BIN_NAME}} cmd/{{.NAME}}/main.go
- upx -9 -k ./{{.BIN_NAME}}
default:
deps:
- hot
silent: true