feat: add build-stamped version with --version flag and TUI header

Introduce tui.Version (defaults to "dev"), stamped at build time via a
VERSION_LDFLAG in the Makefile (-X .../internal/tui.Version=$(VERSION))
across all build targets. main.go handles "--version"/"-v" before
launching the TUI, and the version is shown next to the title in the
header. Docs updated (README + CLAUDE).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
jb
2026-06-19 14:57:05 -03:00
co-authored by Claude Opus 4.8
parent 920fa5e904
commit ef126eaf61
6 changed files with 43 additions and 7 deletions
+8
View File
@@ -145,6 +145,14 @@ make push S3_BUCKET=<bucket> VERSION=<v> # sync dist/ to S3 (version + late
make release S3_BUCKET=<bucket> VERSION=<v> # per-binary copy with OS/arch naming
```
**Versioning:** `tui.Version` ([internal/tui/version.go](internal/tui/version.go))
defaults to `"dev"` and is stamped at build time via `VERSION_LDFLAG`
(`-X .../internal/tui.Version=$(VERSION)`) in the Makefile. `installer --version`
(or `-v`) prints it and exits before the TUI starts; it is also shown in the TUI
header. A plain `go build` leaves it as `"dev"`. The Makefile build rules have no
source deps, so `make build` will not rebuild existing `dist/` artifacts — run
`make clean` first when re-stamping a new VERSION.
Tests (`go test ./...`) cover the pure logic in
[config_test.go](internal/tui/config_test.go) (config.toml/envs generation + numeric
validation) and [form_test.go](internal/tui/form_test.go) (`FormStep.Values()`). The