diff options
| -rw-r--r-- | Makefile | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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); \ |
