-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
80 lines (67 loc) · 1.77 KB
/
Taskfile.yml
File metadata and controls
80 lines (67 loc) · 1.77 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
75
76
77
78
79
80
# https://taskfile.dev
version: '3'
# Build minified assets into web/dist and compile with -tags=prod
vars:
MINIFY_BIN: "minify"
tasks:
# Default: show usage
default:
cmds:
- task -l
silent: true
# deprecated in favor of using the flake provided by nixpkgs
#install-minify:
# desc: Install tdewolff/minify CLI
# cmds:
# - go install github.com/tdewolff/minify/v2/cmd/minify@latest
clean:
desc: Cleans all build artifacts (bin/ and web/dist/)
cmds:
- rm -rf bin
- rm -rf web/dist
minify:
desc: Minify assets into web/dist
cmds:
- mkdir -p web/dist/{css,js}
- cp web/*.html web/dist/
- '{{.MINIFY_BIN}} -r -o web/dist/css/ web/css/'
- '{{.MINIFY_BIN}} -r -o web/dist/js/ web/js/'
build-dev:
desc: Build development binary without -tags=prod
cmds:
- mkdir -p bin
- go build -o bin/gone ./cmd/gone
build-prod:
desc: Build production binary with -tags=prod
deps: [minify]
cmds:
- mkdir -p bin
- go build -tags=prod -o bin/gone ./cmd/gone
prod:
desc: Orchestrate full production build (clean → minify → copy templates → go build -tags=prod)
cmds:
- task: clean
- task: minify
- task: build-prod
dev:
desc: Orchestrate development build (no embed/minify)
cmds:
- task: clean
- task: build-dev
run:
desc: Run development locally
env:
GONE_DATA_DIR: ".tmp"
GONE_METRICS_ADDR: ":9090"
cmds:
- task: clean
- task: dev
- cmd: mkdir -p .tmp
- cmd: bin/gone
interactive: true
ignore_error: true
cover:
desc: Run tests with coverage output
cmds:
- go test -coverprofile=coverage.out ./...
- go tool cover -func=coverage.out