diff options
| author | Leonardo Bishop <me@leonardobishop.net> | 2025-08-07 18:38:36 +0100 |
|---|---|---|
| committer | Leonardo Bishop <me@leonardobishop.net> | 2025-08-07 19:07:36 +0100 |
| commit | 06fb1823bccec72a03b8b5b6ca84052d2e414cf4 (patch) | |
| tree | 4c70a2f9fcb1d4255a44c72e1c03cb8b09a697f0 /0002-Set-version-information-at-build.patch | |
| parent | 658fbb94d5f0e9c10e8753d227bb16c287065ee1 (diff) | |
Diffstat (limited to '0002-Set-version-information-at-build.patch')
| -rw-r--r-- | 0002-Set-version-information-at-build.patch | 40 |
1 files changed, 40 insertions, 0 deletions
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 <me@leonardobishop.net> +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 + |
