-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathTaskfile.yml
98 lines (81 loc) · 2.86 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
88
89
90
91
92
93
94
95
96
97
98
# https://taskfile.dev
version: "3"
interval: 100ms
tasks:
tools:
cmds:
- go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest
- go install github.com/delaneyj/toolbelt/sqlc-gen-zombiezen@latest
- go install github.com/a-h/templ/cmd/templ@latest
- go get github.com/a-h/templ
- go install golang.org/x/tools/cmd/goimports@latest
- platforms: [linux/amd64]
cmd: test -f web/gen/css/tailwindcli || wget -O web/gen/css/tailwindcli https://github.com/dobicinaitis/tailwind-cli-extra/releases/download/v1.7.21/tailwindcss-extra-linux-x64
- platforms: [linux/arm64]
cmd: test -f web/gen/css/tailwindcli || wget -O web/gen/css/tailwindcli https://github.com/dobicinaitis/tailwind-cli-extra/releases/download/v1.7.21/tailwindcss-extra-linux-arm64
- platforms: [darwin/arm64]
cmd: test -f web/gen/css/tailwindcli || wget -O web/gen/css/tailwindcli https://github.com/dobicinaitis/tailwind-cli-extra/releases/download/v1.7.21/tailwindcss-extra-macos-arm64
- platforms: [darwin/amd64]
cmd: test -f web/gen/css/tailwindcli || wget -O web/gen/css/tailwindcli https://github.com/dobicinaitis/tailwind-cli-extra/releases/download/v1.7.21/tailwindcss-extra-macos-x64
- platforms: [windows]
cmd: test -f web/gen/css/tailwindcli || wget -O web/gen/css/tailwindcli https://github.com/dobicinaitis/tailwind-cli-extra/releases/download/v1.7.21/tailwindcss-extra-windows-x64.exe
- platforms: [openbsd, dragonfly, freebsd, netbsd]
cmd: pnpm add tailwindcss @tailwindcss/container-queries @tailwindcss/typography daisyui
- platforms: [openbsd, dragonfly, freebsd, netbsd]
cmd: test -f web/gen/css/tailwindcli || (echo "#!/bin/sh" > web/gen/css/tailwindcli && echo "tailwindcss $@" >> web/gen/css/tailwindcli)
- chmod +x web/gen/css/tailwindcli
css:
dir: web
sources:
- "**/*.templ"
- "**/*.md"
- "**/*.go"
generates:
- "static/css/site.css"
cmds:
- ./gen/css/tailwindcli build -i gen/css/site.css -o static/site.css
sqlc:
dir: sql
sources:
- "**/*.sql"
cmds:
- sqlc generate
- goimports -w .
templ:
env:
TEMPL_EXPERIMENT: rawgo
generates:
- "**/*_templ.go"
sources:
- "**/*.templ"
cmds:
- templ generate .
site:
method: none
desc: build and run site
sources:
- code/go/**/*.templ
- code/go/**/*.go
- code/go/site/static/**/*
generates:
- ./website
deps:
- templ
- sqlc
- css
cmds:
- go mod tidy
- go build -o ./website cmd/site/main.go
- ./website
upx:
cmds:
- go build -ldflags="-s -w" -o website cmd/site/main.go
- upx -9 website
kill:
method: none
cmds:
- fuser -k 4321/tcp > /dev/null 2>&1 || true
default:
deps:
- site
silent: true