summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-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); \