From 3acc0f61ab0ab9fa807f81af7fa90bd98f660ce8 Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Fri, 21 Aug 2026 10:35:06 +0200 Subject: build: publish the latest tag, not strictly HEAD Requiring HEAD to be exactly a tag made the target unusable: the commit that adds the download link to the README necessarily comes after the tag it links to. It now archives the most recent tag and says so when HEAD is ahead of it. --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 936cf1b..6fe82dc 100644 --- a/Makefile +++ b/Makefile @@ -163,10 +163,12 @@ RELEASE_DIR ?= /usr/local/www/cgit RELEASE_NAME ?= colitur-latest.tar.gz release-tarball: ## upload the current tag's tarball as the single published download - @v=$$(git describe --tags --exact-match 2>/dev/null) || \ - { echo "make release-tarball: HEAD is not tagged; tag it first" >&2; exit 1; }; \ + @v=$$(git describe --tags --abbrev=0 2>/dev/null) || \ + { echo "make release-tarball: no tag to publish" >&2; exit 1; }; \ test -z "$$(git status --porcelain)" || \ { echo "make release-tarball: working tree is dirty" >&2; exit 1; }; \ + git describe --tags --exact-match >/dev/null 2>&1 || \ + echo "note: HEAD is ahead of $$v; publishing the tag, not HEAD" >&2; \ echo "packaging $$v"; \ git archive --format=tar.gz --prefix=colitur-$${v#v}/ -o /tmp/$(RELEASE_NAME) "$$v"; \ scp -q /tmp/$(RELEASE_NAME) $(RELEASE_HOST):/tmp/$(RELEASE_NAME); \ -- cgit v1.3