Files
games/Taskfile.yml
Ryan Hamamura 551190b801
All checks were successful
CI / Deploy / test (pull_request) Successful in 15s
CI / Deploy / lint (pull_request) Successful in 28s
CI / Deploy / deploy (pull_request) Has been skipped
Switch to datastar-pro and stop tracking downloaded libs
Datastar-pro is fetched from a private Gitea repo (ryan/vendor-libs)
using VENDOR_TOKEN for CI/Docker builds, with a local fallback from
../optional/ for development. DaisyUI is pinned to v5.5.19 instead of
tracking latest. Downloaded files are now gitignored and fetched at
build time via 'task download', which is a dependency of both build
and live tasks.
2026-03-11 13:17:50 -10:00

91 lines
1.8 KiB
YAML

version: "3"
tasks:
download:
desc: Download pinned client-side libs
cmds:
- go run cmd/downloader/main.go
status:
- test -f assets/js/datastar/datastar.js
- test -f assets/css/daisyui/daisyui.js
build:templ:
desc: Compile .templ files to Go
cmds:
- go tool templ generate
sources:
- "**/*.templ"
generates:
- "**/*_templ.go"
build:styles:
desc: Build TailwindCSS styles
cmds:
- go tool gotailwind -i assets/css/input.css -o assets/css/output.css --minify
sources:
- "assets/css/input.css"
- "**/*.templ"
- "**/*.go"
generates:
- "assets/css/output.css"
build:
desc: Production build to bin/games
cmds:
- go build -o bin/games .
deps:
- download
- build:templ
- build:styles
live:templ:
desc: Watch and recompile .templ files
cmds:
- go tool templ generate -watch
live:styles:
desc: Watch and rebuild TailwindCSS styles
cmds:
- go tool gotailwind -i assets/css/input.css -o assets/css/output.css -w
live:server:
desc: Run server with hot-reload via air
cmds:
- |
go tool air \
-build.cmd "go build -tags=dev -o tmp/bin/games ." \
-build.bin "tmp/bin/games" \
-build.exclude_dir "data,bin,tmp,deploy" \
-build.include_ext "go,templ" \
-misc.clean_on_exit "true"
live:
desc: Dev mode with hot-reload
deps:
- download
- live:templ
- live:styles
- live:server
test:
desc: Run the test suite
cmds:
- go test ./...
lint:
desc: Run golangci-lint
cmds:
- golangci-lint run
run:
desc: Build and run the server
cmds:
- ./bin/games
deps:
- build
default:
desc: Run the default task (live)
cmds:
- task: live