-
Notifications
You must be signed in to change notification settings - Fork 64
/
Copy pathTaskfile.yml
158 lines (133 loc) · 3.91 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# https://taskfile.dev
version: "3"
interval: 100ms
vars:
VERSION:
sh: cat VERSION
tasks:
tools:
platforms: [windows, linux, darwin/arm64, darwin/amd64, openbsd, dragonfly, freebsd, netbsd]
cmds:
- go install github.com/go-task/task/v3/cmd/task@latest
- go install github.com/a-h/templ/cmd/templ@latest
- platforms: [linux/amd64]
cmd: test -f site/tailwindcli || wget -O site/tailwindcli https://github.com/dobicinaitis/tailwind-cli-extra/releases/download/v1.7.21/tailwindcss-extra-linux-x64
- platforms: [linux/arm64]
cmd: test -f site/tailwindcli || wget -O site/tailwindcli https://github.com/dobicinaitis/tailwind-cli-extra/releases/download/v1.7.21/tailwindcss-extra-linux-arm64
- platforms: [darwin/arm64]
cmd: test -f site/tailwindcli || wget -O site/tailwindcli https://github.com/dobicinaitis/tailwind-cli-extra/releases/download/v1.7.21/tailwindcss-extra-macos-arm64
- platforms: [darwin/amd64]
cmd: test -f site/tailwindcli || wget -O site/tailwindcli https://github.com/dobicinaitis/tailwind-cli-extra/releases/download/v1.7.21/tailwindcss-extra-macos-x64
- platforms: [windows]
cmd: test -f site/tailwindcli || wget -O site/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 site/tailwindcli || (echo "#!/bin/sh" > site/tailwindcli && echo "tailwindcss $@" >> site/tailwindcli)
- chmod +x site/tailwindcli
- go install github.com/valyala/quicktemplate/qtc@latest
version:
cmds:
- echo {{.VERSION}}
qtc:
sources:
- "**/*.qtpl"
generates:
- "**/*.qtpl.go"
cmds:
- qtc
build:
deps:
- qtc
sources:
- VERSION
- "**/*.qtpl"
- "**/package.json"
- "**/*.ts"
generates:
- "bundles/**/*"
cmds:
- go run build/cmd/build/main.go
- cp -r bundles/* site/static/js/
- mkdir -p library/dist/
- cp -r bundles/* library/dist/
- mkdir -p site/static/librarySource
- rm -rf site/static/librarySource/*
- cp -r library/src/* site/static/librarySource/
libpub:
dir: library
requires:
vars: [VERSION]
deps:
- build
cmds:
- git push origin
- git tag v{{.VERSION}}
- git push origin --tags
- pnpm i
- pnpm build
- npm publish --access public
- curl https://purge.jsdelivr.net/gh/starfederation/datastar/bundles/datastar.js
- git push origin --tags
- GOPROXY=proxy.golang.org go list -m github.com/starfederation/datastar@v{{.VERSION}}
- task: deploy
css:
dir: site
sources:
- "**/*.templ"
- "**/*.md"
- "**/*.go"
generates:
- "static/css/site.css"
cmds:
- ./tailwindcli build -i src/css/site.css -o static/css/site.css
templ:
env:
TEMPL_EXPERIMENT: rawgo
generates:
- "**/*_templ.go"
sources:
- "**/*.templ"
cmds:
- templ generate .
kill:
method: none
cmds:
- fuser -k 8080/tcp > /dev/null 2>&1 || true
support:
sources:
- "**/*.templ"
- "**/*.go"
- "**/*.md"
- site/static/**/*
generates:
- ./datastar-website
deps:
- kill
- build
- templ
- css
site:
method: none
desc: build and run site
deps:
- support
cmds:
- go mod tidy
- go build -o ./datastar-website "site/cmd/site/main.go"
deploy:
method: none
deps:
- support
cmds:
- fly deploy --local-only
test:
dir: site/smoketests
deps:
- support
cmds:
- go test -v
default:
cmds:
- task: site
- ./datastar-website