From 06fb1823bccec72a03b8b5b6ca84052d2e414cf4 Mon Sep 17 00:00:00 2001 From: Leonardo Bishop Date: Thu, 7 Aug 2025 18:38:36 +0100 Subject: Set version information at build --- 0002-Set-version-information-at-build.patch | 40 +++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 0002-Set-version-information-at-build.patch (limited to '0002-Set-version-information-at-build.patch') diff --git a/0002-Set-version-information-at-build.patch b/0002-Set-version-information-at-build.patch new file mode 100644 index 0000000..c4aa677 --- /dev/null +++ b/0002-Set-version-information-at-build.patch @@ -0,0 +1,40 @@ +From f38b2c15ae796ade9f9779974dc5c237597b0829 Mon Sep 17 00:00:00 2001 +From: Leonardo Bishop +Date: Thu, 7 Aug 2025 18:00:34 +0100 +Subject: [PATCH 2/2] Set version information at build + +--- + Makefile | 6 +++++- + walrss/internal/core/version.go | 2 +- + 2 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/Makefile b/Makefile +index 93f2b71..a3300fb 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,8 +1,12 @@ + .PHONY: dockerBuild + ++VERSION := $(shell git describe --tags --abbrev=7 | sed "s/^v//") ++ ++all: build ++ + build: templates + mkdir -p bin +- go build -o bin/walrss github.com/codemicro/walrss/walrss ++ go build -ldflags "-X 'github.com/codemicro/walrss/walrss/internal/core.Version=${VERSION}'" -o bin/walrss github.com/codemicro/walrss/walrss + + run: build + mkdir -p run +diff --git a/walrss/internal/core/version.go b/walrss/internal/core/version.go +index 0b535ea..00a83ad 100644 +--- a/walrss/internal/core/version.go ++++ b/walrss/internal/core/version.go +@@ -1,3 +1,3 @@ + package core + +-const Version = "" ++var Version = "" +-- +2.50.1 + -- cgit v1.2.3-70-g09d2