fix(makefile): read release version from CHANGELOG heading

The old pattern 'grep -om1 "v[0-9].*"' matched the first vN.N.N anywhere in
the file, so any mention of a module pseudo-version above the release heading
silently corrupted the build version (e.g. it produced
"v0.0.0-20261102152715-54038813c47f`." as main.version). Anchor it to the
## vX.Y.Z heading instead.
This commit is contained in:
MayconVM authored and Jorge Fernando dos Santos committed 2026-11-09 11:11:21 -03:00
1 parent ab5f84213f
commit 70ecc1746c
2 files changed
+6 -6

No files matched your search

+1 -1
View File
@@ -5,7 +5,7 @@ APP_NAME=evolution-go
MAIN_PATH=cmd/evolution-go/main.go
BUILD_DIR=build
GO=go
VERSION=$(shell grep -om1 "v[0-9].*" CHANGELOG.md)
VERSION=$(shell sed -n 's/^## \(v[0-9][^ ]*\).*/\1/p' CHANGELOG.md | head -1)
LDFLAGS=-ldflags "-X main.version=$(VERSION)"
GOFLAGS=-v