From 9a828d2037edb4f861de7f4b431bad048c87bea1 Mon Sep 17 00:00:00 2001 From: Allisson Azevedo Date: Sat, 28 Feb 2026 18:37:58 -0300 Subject: [PATCH] fix(build): Correct build metadata injection in Goreleaser Update ldflags to include buildDate and commitSHA during the build process. Add build flags for proper static compilation. Bump version to v0.22.1 and update the changelog. --- .goreleaser.yaml | 5 ++++- CHANGELOG.md | 9 +++++++-- cmd/app/main.go | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 1971518..720cadc 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -18,8 +18,11 @@ builds: goarch: - amd64 - arm64 + flags: + - -a + - -installsuffix=cgo ldflags: - - -s -w -X main.version={{.Version}} + - -s -w -X main.version={{.Version}} -X main.buildDate={{.Date}} -X main.commitSHA={{.FullCommit}} archives: - formats: [ "tar.gz" ] diff --git a/CHANGELOG.md b/CHANGELOG.md index 8af8fab..1a266d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ 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.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.22.1] - 2026-02-28 + +### Fixed +- Corrected Goreleaser configuration to properly inject build metadata (`buildDate`, `commitSHA`) into the binary. + ## [0.22.0] - 2026-02-28 ### Added @@ -388,8 +393,8 @@ If you are using `sslmode=disable` (PostgreSQL) or `tls=false` (MySQL) in produc - Security model documentation - Architecture documentation -[0.21.0]: https://github.com/allisson/secrets/compare/v0.20.0...v0.21.0 -[0.20.0]: https://github.com/allisson/secrets/compare/v0.19.0...v0.20.0 +[0.22.1]: https://github.com/allisson/secrets/compare/v0.22.0...v0.22.1 +[0.22.0]: https://github.com/allisson/secrets/compare/v0.21.0...v0.22.0 [0.19.0]: https://github.com/allisson/secrets/compare/v0.18.0...v0.19.0 [0.18.0]: https://github.com/allisson/secrets/compare/v0.17.0...v0.18.0 [0.17.0]: https://github.com/allisson/secrets/compare/v0.16.0...v0.17.0 diff --git a/cmd/app/main.go b/cmd/app/main.go index 5755882..8f0aff6 100644 --- a/cmd/app/main.go +++ b/cmd/app/main.go @@ -12,7 +12,7 @@ import ( // Build-time version information (injected via ldflags during build). var ( - version = "v0.22.0" // Semantic version with "v" prefix (e.g., "v0.12.0") + version = "v0.22.1" // Semantic version with "v" prefix (e.g., "v0.12.0") buildDate = "unknown" // ISO 8601 build timestamp commitSHA = "unknown" // Git commit SHA )