Add versioning support to build artifacts and log outputs

- Introduced `Version` variable, set during build via `-ldflags`, to embed application version.
- Updated Dockerfile to accept `APP_VERSION` argument for version injection during build.
- Modified `.goreleaser.yml` to pass GitHub release tag as version via `ldflags`.
- Added version logging in the application startup.
This commit is contained in:
Luis Pater
2025-09-05 22:53:49 +08:00
parent 4f18809500
commit 8d05489973
4 changed files with 11 additions and 1 deletions
+2
View File
@@ -9,6 +9,8 @@ builds:
- arm64
main: ./cmd/server/
binary: cli-proxy-api
ldflags:
- -X 'main.Version={{.GORELEASER_CURRENT_TAG}}'
archives:
- id: "cli-proxy-api"
format: tar.gz