aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-08-21 10:35:06 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-08-21 10:35:06 +0200
commit3acc0f61ab0ab9fa807f81af7fa90bd98f660ce8 (patch)
tree8f9e82b6fe0cce342ffadcbb0d052ca951879448
parent75ba0a85b82823c9b030ce2a1297b0ea4be7fee4 (diff)
downloadcolitur-3acc0f61ab0ab9fa807f81af7fa90bd98f660ce8.tar.gz
colitur-3acc0f61ab0ab9fa807f81af7fa90bd98f660ce8.zip
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.
-rw-r--r--Makefile6
1 files changed, 4 insertions, 2 deletions
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); \