protocol/Makefile: ensure that we don't release from a branch other than master or a dirty working tree.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
Daira Hopwood 2020-08-28 13:30:07 +01:00
parent 1ce341565f
commit 87a0670225
1 changed files with 2 additions and 0 deletions

View File

@ -28,8 +28,10 @@ ifeq ($(shell git tag --points-at HEAD |wc -l),0)
echo "Set a tag at HEAD first."
else
$(eval TAG := $(shell git tag --points-at HEAD))
if [[ "$(shell git rev-parse --abbrev-ref HEAD)" != "master" ]]; then echo "Not on master."; exit 1; fi
$(MAKE) clean all
git commit -m "Regenerate PDFs." *.pdf
if [[ "$(shell git diff HEAD |wc -l)" != "0" ]]; then echo "The working tree is not clean."; exit 1; fi
git tag "v$(TAG)"
git push --tags origin HEAD:master
endif