Files
games/Taskfile.yml
Ryan Hamamura 2bea5bb489
Some checks failed
CI / Deploy / test (pull_request) Failing after 13s
CI / Deploy / lint (pull_request) Failing after 24s
CI / Deploy / deploy (pull_request) Has been skipped
chore: gitignore generated _templ.go files, track .templ sources
Generated _templ.go files are deterministic output from .templ sources,
same as output.css from input.css. Remove them from version control to
reduce diff noise and merge conflicts. Add build:templ and live:templ
tasks to the Taskfile so generation happens as part of the build.
2026-03-02 15:27:38 -10:00

86 lines
1.7 KiB
YAML

version: "3"
tasks:
download:
desc: Download latest client-side libs
cmds:
- go run cmd/downloader/main.go
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/c4
cmds:
- go build -o bin/c4 .
deps:
- 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/c4 ." \
-build.bin "tmp/bin/c4" \
-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:
- 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/c4
deps:
- build
default:
desc: Run the default task (live)
cmds:
- task: live