Prechádzať zdrojové kódy

adds new zip, tar.gz, and tar.xz release archive build script with build target in directory external to repository, shellcheck testing, new makefile archives target (#325)

Chris Simpkins 7 rokov pred
rodič
commit
11a754dbaf

+ 4 - 1
Makefile

@@ -1,5 +1,8 @@
 all: build
 
+archives:
+	postbuild_processing/archive_prep/archiver.sh
+
 build: ttf webfonts
 
 build-with-dependencies: source/*.ufo
@@ -10,7 +13,7 @@ build-with-dependencies: source/*.ufo
 
 lint: shellcheck ufolint
 
-shellcheck: build-ttf.sh build-woff.sh build-woff2.sh build-subsets.sh tools/scripts/install/ttfautohint-build.sh
+shellcheck: build-ttf.sh build-woff.sh build-woff2.sh build-subsets.sh tools/scripts/install/ttfautohint-build.sh postbuild_processing/archive_prep/archiver.sh
 	$@ $^
 
 subsets: source/*.ufo

+ 46 - 0
postbuild_processing/archive_prep/archiver.sh

@@ -0,0 +1,46 @@
+#!/bin/sh
+
+# ////////////////////////////////////////////////////////////////////
+#
+# archiver.sh
+#  A shell script that packages .zip, tar.gz, and tar.xz font archives
+#  Copyright 2017 Christopher Simpkins
+#  MIT License
+#
+#  Usage: ./archiver.sh
+#
+# ////////////////////////////////////////////////////////////////////
+
+HACK_VERSION="v3.000"
+HACK_ARCHIVES_DIR="../../Hack-archives"
+HACK_BUILD_DIR="build"
+
+
+# Make build directory the current working directory
+cd "$HACK_BUILD_DIR" || exit 1
+
+# Cleanup Hack-archives directory if present
+if [ -d "$HACK_ARCHIVES_DIR" ]; then
+	rm -rf "$HACK_ARCHIVES_DIR"
+fi
+
+# Make the archive directory
+mkdir "$HACK_ARCHIVES_DIR"
+
+# Build ttf zip archive
+zip -r "${HACK_ARCHIVES_DIR}/Hack-${HACK_VERSION}-ttf.zip" ttf -x "*.DS_Store"
+
+# Build web font zip archive
+zip -r "${HACK_ARCHIVES_DIR}/Hack-${HACK_VERSION}-webfonts.zip" web -x "*.DS_Store"
+
+# Build ttf tar.gz archive
+tar -c --exclude=".DS_Store" --exclude="./.DS_Store" --exclude="./*/.DS_Store" -vzf "${HACK_ARCHIVES_DIR}/Hack-${HACK_VERSION}-ttf.tar.gz" ttf
+
+# Build web font tar.gz archive
+tar -c --exclude=".DS_Store" --exclude="./.DS_Store" --exclude="./*/.DS_Store" -vzf "${HACK_ARCHIVES_DIR}/Hack-${HACK_VERSION}-webfonts.tar.gz" web
+
+# Build ttf tar.xz archive
+tar -c --exclude=".DS_Store" --exclude="./.DS_Store" --exclude="./*/.DS_Store" -C ttf . | xz --extreme -9 --force > "${HACK_ARCHIVES_DIR}/Hack-${HACK_VERSION}-ttf.tar.xz"
+
+# Build web font tar.xz archive
+tar -c --exclude=".DS_Store" --exclude="./.DS_Store" --exclude="./*/.DS_Store" -C web . | xz --extreme -9 --force > "${HACK_ARCHIVES_DIR}/Hack-${HACK_VERSION}-webfonts.tar.xz"

+ 0 - 17
postbuild_processing/archive_prep/make_tarxz.sh

@@ -1,17 +0,0 @@
-#!/bin/sh
-
-HACK_VERSION="v2_020"
-HACK_BUILD_DIR="../../build"
-
-
-# Make build directory the current working directory
-cd "$HACK_BUILD_DIR"
-
-# Build ttf file archive
-tar c --exclude=.DS_Store --exclude=./.DS_Store --exclude=./*/.DS_Store -C ttf . | xz --extreme -9 --force > "archives/Hack_${HACK_VERSION}-ttf.tar.xz"
-
-# Build otf file archive
-tar c --exclude=.DS_Store --exclude=./.DS_Store --exclude=./*/.DS_Store -C otf . | xz --extreme -9 --force  > "archives/Hack_${HACK_VERSION}-otf.tar.xz"
-
-# Build web font file archive
-tar c --exclude=.DS_Store --exclude=./.DS_Store --exclude=./*/.DS_Store -C webfonts . | xz --extreme -9 --force > "archives/Hack_${HACK_VERSION}-webfonts.tar.xz"