-
Notifications
You must be signed in to change notification settings - Fork 2
/
Taskfile.yml
85 lines (72 loc) · 2.48 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
version: "3"
tasks:
test:
cmds:
- task: build-version
- go test ./... -coverprofile=cover.out {{.CLI_ARGS}}
vars:
PWD:
sh: echo '$(pwd)'
test:cover:
cmds:
- task: build-version
- go tool cover -html=cover.out
test:cover:total:
cmds:
- task: build-version
- task: test
- go tool cover -func cover.out
build:
cmds:
- task: build-version
- templ generate
- go run . build
web:
cmds:
- task: build-version
- templ generate
- go run . web
dev:templ:
cmds:
- task: build-version
- templ generate -watch --cmd="go run . web"
dev:watch:
cmds:
- task: build-version
# pip install watchdog[watchmedo]
- >
~/venv/bin/watchmedo auto-restart
--patterns "*.templ;*.go;*.css;*.js;enverant.json"
-i "*_templ.go"
--recursive
-- sh -c "task web; sleep infinity"
build:test:
cmds:
- task: build-version
- mkdir -p dist
- rm dist/darkstat-linux-amd64 | true
- GOOS=linux GOARCH=amd64 go build -v -o dist/darkstat-linux-amd64 main.go
build-version:
cmds:
- autogit semver --publish > darkstat/settings/version.txt || echo 'v0.0.0' > darkstat/settings/version.txt
build:bins:
cmds:
- task: build-version
- mkdir -p dist
- rm dist/* | true
- GOOS=linux GOARCH=amd64 go build -v -o dist/darkstat-linux-amd64 main.go
- GOOS=linux GOARCH=arm64 go build -v -o dist/darkstat-linux-arm64 main.go
- GOOS=windows GOARCH=amd64 go build -v -o dist/darkstat-windows-amd64.exe main.go
- GOOS=windows GOARCH=arm64 go build -v -o dist/darkstat-windows-arm64.exe main.go
- GOOS=darwin GOARCH=amd64 go build -v -o dist/darkstat-macos-amd64 main.go
- GOOS=darwin GOARCH=arm64 go build -v -o dist/darkstat-macos-arm64 main.go
# We can build for those too, but i don't think they are needed
# - GOOS=linux GOARCH=386 go build -v -o dist/darkstat-linux-386 main.go
# - GOOS=linux GOARCH=arm go build -v -o dist/darkstat-linux-arm main.go
# - GOOS=windows GOARCH=386 go build -v -o dist/darkstat-windows-386.exe main.go
# - GOOS=windows GOARCH=arm go build -v -o dist/darkstat-windows-arm.exe main.go
hook:prod:
cmds:
- sudo rm /usr/local/bin/darkstat | true
- GOOS=linux GOARCH=amd64 go build -v -o dist/darkstat-linux-amd64 main.go
- sudo ln -s {{.PWD}}/dist/darkstat-linux-amd64 /usr/local/bin/darkstat