From 30166b07fc53e98b91c6884c07e2c1e2ec119ca3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Sch=C3=BCller?= Date: Fri, 10 Jan 2025 11:31:26 +0100 Subject: [PATCH] Makefile: fix packer version by using git tag For releases this does not change anything, as the version in the spec file is the same as the git tag. For intermediate/tainted versions packer seems to patch the spec file to the version given in `.packit.yaml` (which is the latest git-tag), then the filename and version would be inconsistent. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 79a5a87..5e1abff 100644 --- a/Makefile +++ b/Makefile @@ -47,7 +47,7 @@ GOLANGCI_COMPOSER_IMAGE=composer_golangci # pre-fetched but evaluated at time of use. # -VERSION := $(shell (cd "$(SRCDIR)" && grep "^Version:" image-builder-cli.spec | sed -n 's/^[^0-9]*\([1-9][0-9]*\(\.[1-9][0-9]*\)*\)/\1/p')) +VERSION := $(shell ( git describe --tags --abbrev=0 2>/dev/null || echo v1 ) | sed 's|v||') COMMIT = $(shell (cd "$(SRCDIR)" && git rev-parse HEAD)) PACKAGE_NAME_VERSION = image-builder-cli-$(VERSION) PACKAGE_NAME_COMMIT = image-builder-cli-$(COMMIT)