diff --git a/.gitignore b/.gitignore index 3ce430d42..73d2644ce 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,4 @@ *.tdo hpmor-*.pdf hpmor.pdf +hpmor*.zip diff --git a/GNUmakefile b/GNUmakefile new file mode 100644 index 000000000..fda92dfd1 --- /dev/null +++ b/GNUmakefile @@ -0,0 +1,18 @@ +# Make a PDF release + +PROJECT=hpmor + +TAG := $(shell git describe --tags) +VERSION := $(shell echo $(TAG) | sed -e 's/^v//') +ZIPFILE = $(PROJECT)-$(VERSION).zip + +all: + latexmk -g && \ + rm -f $(ZIPFILE) && \ + zip $(ZIPFILE) *.pdf + +# To make a release: git tag vx.y && git push --tags && make release +# Needs woger from https://github.com/rrthomas/woger/ +release: all + git diff --exit-code && \ + woger github github_user=rjl20 package=$(PROJECT) version=$(VERSION) dist_type=zip github_dist_type=pdf diff --git a/README.md b/README.md index 2b565200a..a33f6d0e1 100644 --- a/README.md +++ b/README.md @@ -27,12 +27,15 @@ and there are no appendices. individual volumes `hpmor-N.tex`. * `fonts/` - various fonts used * `latexmkrc` - configures latexmk to run LaTeX to build the PDFs. +* `GNUMakefile` - contains targets to make a Zip of the PDFs and release them + to GitHub. (Mostly of interest to project maintainers.) ## Building the book(s) * `latexmk`: Build all PDFs. (If in doubt, just run this command and do something else for twenty minutes!) +* `make all`: Build a Zip of the PDFs. * `latexmk hpmor`: Build the one-volume PDF `hpmor.pdf` * `latexmk hpmor-N`: Build one of the six individual volumes `hpmor-1.pdf` to `hpmor-6.pdf`.