From 3e14d1002c816cf34fa4b7ac1847fc83dc12151b Mon Sep 17 00:00:00 2001 From: oth-body Date: Mon, 14 Sep 2026 21:37:10 -0400 Subject: [PATCH] =?UTF-8?q?chore:=20release=20prep=20=E2=80=94=20version?= =?UTF-8?q?=20injection,=20CHANGELOG,=20close=20#49?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves #49 by completing the remaining release preparation items. What changed: - version/commit/date are now vars (not const) so goreleaser's ldflags can inject them at build time. Plain 'go build' shows 'hoot dev (commit none, built unknown)'; tagged releases show the real version, commit hash, and build date. - 'hoot -version' output now includes commit and date. - Added CHANGELOG.md covering all fixes from PRs #65-#71. - Updated TestVersion to match the new output format. What was already done (checked off in the issue): - .goreleaser.yml with multi-platform builds + ldflags - .github/workflows/release.yml (tag-triggered) - .github/workflows/ci.yml (tests + cross-build matrix) - LICENSE (MIT) - README.md - .gitignore (binary exclusions) - Config dir uses 'hoot' (not 'nostr-cli') - 9 test files across 3 packages Closes #49 --- CHANGELOG.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ hoot.go | 12 ++++++++++-- hoot_test.go | 2 +- 3 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..ee03018 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,46 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +### Fixed +- NIP-46 QR login: render QR code correctly in half-block Unicode glyphs (#65, #66) +- NIP-46 QR login: show live spinner while waiting, clear stale "Generating" banner (#67) +- NIP-46 QR login: center title, QR, and footers as one cohesive block (#68) +- NIP-46: dial all configured relays instead of only the first; retry on failure (#69, #70) +- Event cache shadowed by := — caching was silently broken (#71) +- DM decryption used raw private key instead of shared secret — DMs always empty (#71) +- Text input blocked at cursor states 51/200 — couldn't type nsec or unlock profiles (#71) +- NIP-89 handler registration used wrong kind (1984 instead of 31990) (#71) +- NIP-89 'a' tag format reversed (was pubkey:d:kind, now kind:pubkey:d) (#71) +- Missing bounds check on tag elements — potential panic on malformed events (#71) +- DMs/Replies withLoading errors silently discarded (#71) +- Context leak from defer cancel() inside relay loop (#71) +- Home screen cursor unbounded — could scroll past menu items (#71) +- NIP-46 publishToAllRelays failed on first relay error even if others succeeded (#71) +- publishPostTUI ignored GetPublicKey/Sign errors (#71) +- CI: skip TestStoreAndLoadKey when no interactive TTY available (#65) + +### Changed +- Build-time version injection via ldflags (version, commit, date) +- `hoot -version` now shows commit hash and build date + +## [0.0.4] - 2024-12-01 + +### Added +- Initial TUI with Bubble Tea +- NIP-46 remote signer support (Amber QR scan) +- Multi-profile management +- NWC tipping via Lightning +- NIP-89 app handler registration +- Direct messages view +- Replies/reactions view +- Relay management +- Event caching with SQLite + +[Unreleased]: https://github.com/oth-body/hoot/compare/v0.0.4...HEAD +[0.0.4]: https://github.com/oth-body/hoot/releases/tag/v0.0.4 diff --git a/hoot.go b/hoot.go index a10ccd6..71716a8 100644 --- a/hoot.go +++ b/hoot.go @@ -33,7 +33,15 @@ const ( appName = "hoot" keyFileName = "nostr_key.enc" profilesFileName = "profiles.json" - version = "0.0.4" // Define the version here +) + +// version, commit, and date are set at build time by goreleaser via +// ldflags: -X main.version=... -X main.commit=... -X main.date=... +// When built with plain `go build`, they keep their defaults. +var ( + version = "dev" + commit = "none" + date = "unknown" ) // defaultRelays is the set of relays hoot publishes to when the user @@ -1349,7 +1357,7 @@ func main() { // Handle version flag if *versionPtr { - fmt.Printf("hoot version %s\n", version) + fmt.Printf("hoot %s (commit %s, built %s)\n", version, commit, date) return } diff --git a/hoot_test.go b/hoot_test.go index 7fb51f9..af2211f 100644 --- a/hoot_test.go +++ b/hoot_test.go @@ -76,7 +76,7 @@ func TestVersion(t *testing.T) { if err != nil { t.Fatalf("Failed to run -version: %v, output: %s", err, output) } - if !strings.Contains(output, "hoot version") { + if !strings.Contains(output, "hoot ") { t.Errorf("Expected version output, got: %s", output) } }