A collection of reusable go-task Taskfile fragments. Include this repository directly from GitHub (main branch) in your project's Taskfile.yml to pull in common tasks — cleanup, Go builds, OS package updates, uv sync, and elapsed-time reporting.
includes:
_time: https://raw.githubusercontent.com/sig9org/tasks/main/tasks/_time.yml
_go: https://raw.githubusercontent.com/sig9org/tasks/main/tasks/_go.ymlRemote Taskfiles are an experimental go-task feature, so the consuming project must enable TASK_X_REMOTE_TASKFILES=1 (otherwise task fails with Remote taskfiles are not enabled.). See https://taskfile.dev/experiments/remote-taskfiles for details.
Each library is provided as internal: true tasks. Include it under any name (by convention _cleanup, etc.) and define your own tasks that call into it (see examples/).
| Library | What it provides |
|---|---|
_cleanup.yml |
Removes .idea / .terraform / .vscode and OS junk files, and force-refreshes the remote Taskfile cache |
_go.yml |
Build for the current platform, cross-compile for all platforms, clean dist, go vet / go test |
_os.yml |
Detects Amazon Linux / macOS (Homebrew) / Ubuntu and checks for, applies, or removes unnecessary packages accordingly |
_time.yml |
Records a task's start/end time and prints the elapsed time |
_uv.yml |
Freeze/sync packages with uv |
examples/ contains sample Taskfiles (one per subdirectory, each a Taskfile.yml) wiring up each library.
examples/cleanup/Taskfile.yml—cleanup(c)examples/go/Taskfile.yml—cleanup(c),go-all-build(ga),go-build(gb),go-clean(gc),go-register(gr),go-test(gt),go-version(gv)- Expects
BINARY_NAME/VERSION_PKGto be provided viaproject.ini(dotenv).
- Expects
examples/os/Taskfile.yml—cleanup(c),os-check(oc),os-remove(or),os-update(ou)examples/uv/Taskfile.yml—cleanup(c),uv-freeze(uf),uv-sync(us)
Every task depends on _time:start and places defer: { task: _time:end, vars: { START_TIME: '{{.START_TIME}}' } } first in cmds:, so the elapsed-time display always runs regardless of whether the task succeeds or fails.
tasks/_*.yml, examples/*/Taskfile.yml, and the root Taskfile.yml are all generated output. Don't edit them directly — edit the fragments under templates/ and config.yml, then regenerate.
- Copy
config.yml.exampletoconfig.ymland edit thetemplates:roots,sets:, and per-file output definitions (the combination ofheaders/vars/tasks/includes) as needed. - Edit the fragments under the template roots:
templates/tasks/{headers,vars,tasks,includes}/— sources for this repo's own published internal libraries (tasks/_*.yml).templates/example/{headers,vars,tasks,includes}/— sources for the example consumer Taskfiles (examples/*/Taskfile.yml) and the rootTaskfile.yml.
- Run
task generate-tasks(aliasg) to regeneratetasks/_*.yml,examples/*/Taskfile.yml, andTaskfile.ymlviagotasky.
This repository's own Taskfile.yml also provides:
task cleanup(aliasc) — removes unnecessary files and force-refreshes the remote Taskfile cache
