feat(version): bake release tag into binary; About card and /health field
Release / build-and-push (push) Successful in 3m1s

The version tag previously existed only in git and the Docker image tag —
the running app had no way to report what build it was. Version is now
injected at build time via -ldflags into internal/version.Version (defaults
to "dev" for local builds), passed by the release workflow as the
APP_VERSION Docker build arg from the pushed tag.

Surfaced in Admin → Settings → About (extensible card for future rows like
disk space) and in the /health JSON response, so deployments can be
verified with curl alone.
This commit is contained in:
John O'Keefe
2026-09-21 20:21:43 -04:00
parent 9e4cc4efd0
commit 1c1f5cf1bb
6 changed files with 121 additions and 20 deletions
+20 -1
View File
@@ -1,6 +1,9 @@
package templates
import "fmt"
import (
"bookhoard/internal/version"
"fmt"
)
templ AdminSettings(user User, systemConfig map[string]string, scanSettings ScanSettingsData, liveGroups []SettingGroup, restartGroups []SettingGroup, errorMessage string) {
<!DOCTYPE html>
@@ -111,6 +114,7 @@ templ AdminSettings(user User, systemConfig map[string]string, scanSettings Scan
@ScanSettingsSection(scanSettings)
@TunableSettingsSection(liveGroups, false)
@TunableSettingsSection(restartGroups, true)
@AboutSection()
</div>
</main>
</body>
@@ -255,3 +259,18 @@ templ TunableSettingRow(e SettingEntry) {
<span id={ "status-" + e.Key } class="text-xs w-24 text-right" style="color: var(--text-secondary)"></span>
</div>
}
// AboutSection shows build metadata, rendered at the bottom of the System
// Settings page. Add future rows (disk space, uptime, Go version, …) to the
// list below.
templ AboutSection() {
<div class="mt-6 card p-6">
<div class="flex items-center gap-2 mb-4">
@Icon("info", "h-5 w-5 shrink-0")
<h3 class="text-lg font-semibold" style="color: var(--text-primary)">About</h3>
</div>
<div class="space-y-2 text-sm" style="color: var(--text-secondary);">
<p><span class="font-medium uppercase tracking-wide text-xs" style="color: var(--text-secondary)">Version:</span> { version.Version }</p>
</div>
</div>
}