From eda835f2f2258bc099e582d57d394dae1e9786d8 Mon Sep 17 00:00:00 2001 From: Rasmus Andersson Date: Tue, 22 Aug 2017 12:46:29 -0700 Subject: release v1.1 --- Makefile | 54 ++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 42 insertions(+), 12 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 6ce4dda73..d0948c643 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,8 @@ # all: all_web all_otf +VERSION := $(shell misc/version.py) + # generated.make is automatically generated by init.sh and defines depenencies for # all styles and alias targets include build/etc/generated.make @@ -56,8 +58,11 @@ build/%.woff: build/%.ttf # build/%.eot: build/%.ttf # ttf2eot "$<" > "$@" -# TTF -> zip -zip: all +ZIP_FILE_DIST := build/release/Interface-${VERSION}.zip +ZIP_FILE_DEV := build/release/Interface-${VERSION}-$(shell git rev-parse --short=10 HEAD).zip + +# zip intermediate +build/.zip.zip: all @rm -rf build/.zip @rm -f build/.zip.zip @mkdir -p \ @@ -65,17 +70,42 @@ zip: all "build/.zip/Interface (hinted TTF)" \ "build/.zip/Interface (TTF)" \ "build/.zip/Interface (OTF)" - cp -a build/dist/*.woff build/dist/*.woff2 "build/.zip/Interface (web)/" - cp -a build/dist/*.ttf "build/.zip/Interface (hinted TTF)/" - cp -a build/dist-unhinted/*.ttf "build/.zip/Interface (TTF)/" - cp -a build/dist-unhinted/*.otf "build/.zip/Interface (OTF)/" - cp -a misc/doc/install-*.txt "build/.zip/" - cd build/.zip && zip -v -X -r "../../build/.zip.zip" * - @mkdir -p build/release - @mv -f build/.zip.zip build/release/Interface-`date '+%Y%m%d'`.zip - @echo write build/release/Interface-`date '+%Y%m%d'`.zip + @cp -a build/dist/*.woff build/dist/*.woff2 "build/.zip/Interface (web)/" + @cp -a build/dist/*.ttf "build/.zip/Interface (hinted TTF)/" + @cp -a build/dist-unhinted/*.ttf "build/.zip/Interface (TTF)/" + @cp -a build/dist-unhinted/*.otf "build/.zip/Interface (OTF)/" + @cp -a misc/doc/install-*.txt "build/.zip/" + cd build/.zip && zip -v -X -r "../../build/.zip.zip" * >/dev/null && cd ../.. @rm -rf build/.zip +# zip +build/release/Interface-%.zip: build/.zip.zip + @mkdir -p "$(shell dirname "$@")" + @mv -f "$<" "$@" + @echo write "$@" + +zip: ${ZIP_FILE_DEV} +zip_dist: ${ZIP_FILE_DIST} + +dist: + @echo "Creating distribution for version ${VERSION}" + @if [ -f "${ZIP_FILE_DIST}" ]; \ + then echo "${ZIP_FILE_DIST} already exists. Bump version or remove the zip file to continue." >&2; \ + exit 1; \ + fi + @$(MAKE) zip_dist + rm -rf docs/font-files + mkdir docs/font-files + cp -a build/dist/*.woff build/dist/*.woff2 docs/font-files/ + @echo "——————————————————————————————————————————————————————————————————" + @echo "" + @echo "Next step:" + @echo " Create new release with ${ZIP_FILE_DIST} at" + @echo "" + @echo " https://github.com/rsms/interface/releases/new?tag=v${VERSION}" + @echo "" + @echo "——————————————————————————————————————————————————————————————————" + install_ttf: all_ttf @echo "Installing TTF files locally at ~/Library/Fonts/Interface" rm -rf ~/Library/Fonts/Interface @@ -103,4 +133,4 @@ _local/UnicodeData.txt: clean: rm -vrf build/tmp/* build/dist/Interface-*.* -.PHONY: all web clean install install_otf install_ttf deploy zip glyphinfo +.PHONY: all web clean install install_otf install_ttf deploy zip zip_dist dist glyphinfo -- cgit v1.2.3