From 9bbe31d61bf826307951ab93eded85e59d61790b Mon Sep 17 00:00:00 2001 From: Fini Jastrow Date: Tue, 21 Nov 2023 14:18:26 +0100 Subject: [PATCH] Add small tool to create release artefact table Usage is a bit ... hard, because we need to do this before the release is published. Download the complete artifact zip archive from the release-drafting run. Unpack it into the repository (will end up in patched-fonts/) Pack all archives with archive-fonts.sh Then use this tool to extract the names and sizes of the artifacts. Signed-off-by: Fini Jastrow --- bin/scripts/README.md | 1 + bin/scripts/generate-release-summary.sh | 31 +++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100755 bin/scripts/generate-release-summary.sh diff --git a/bin/scripts/README.md b/bin/scripts/README.md index daca0db25..a17c8437f 100644 --- a/bin/scripts/README.md +++ b/bin/scripts/README.md @@ -16,6 +16,7 @@ Note: Usually you need to call the scripts in this directory while actually bein * `generate-font-image-previews.sh`: Generates the preview images for `nerdfonts.com` (i.e. gh-pages) [3] * `generate-glyph-info-from-set.py`: Generate the `i_xxx.sh` file from a glyph source (font) file, if the glyphs are named correctly [4] * `generate-original-source.py`: Generate `original-source.otf` from single glyph svgs. [5] +* `generate-release-summary.sh`: Helper to generate the release table with zip and xz [3] * `generate-sample-set.sh`: Generate one patched font file from each source font (for manual checks) [4] * `generate-webfonts.sh`: Generate woff and woff2 font files from the SymbolsOnly font (for the gh-pages) [1] * `get-font-names-from-json.sh`: Helper to setup the CI font matrix from `data/fonts.json` [1] diff --git a/bin/scripts/generate-release-summary.sh b/bin/scripts/generate-release-summary.sh new file mode 100755 index 000000000..adacf6d28 --- /dev/null +++ b/bin/scripts/generate-release-summary.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +sd="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." >/dev/null 2>&1 || exit && pwd -P)" +archivedir=${sd}/../../archives +url=https://github.com/ryanoasis/nerd-fonts/releases/download/v3.1.0/ + +all=$(find "${archivedir}" -name '*.zip' | sed 's/\.zip$//;s/.*\///' | sort) + +echo "## Release archives" +echo "You can select between \`zip\` or \`tar.xz\`. The later are far smaller (about 1/10). Please leave feedback in #1233 if you use the \`xz\` version." +echo +echo "[FontPatcher here](${url}FontPatcher.zip) only as \`zip\`." +echo +echo "Because the artifacts list is now even longer, here listed next to each other (open details, sizes are approximate):" +echo +echo "
" +echo +echo "| Font | | |" +echo "|------|---|---|" + + +for font in $all; do + # shellcheck disable=SC2012 # The human readable size is all we want + zsize=$(LC_ALL=C ls -hs "${archivedir}/${font}.zip" | sed 's/ .*//') + # shellcheck disable=SC2012 # The human readable size is all we want + xsize=$(LC_ALL=C ls -hs "${archivedir}/${font}.tar.xz" | sed 's/ .*//') + echo "| ${font} | [Zip archive (${zsize})](${url}${font}.zip) | [XZ archive (${xsize})](${url}${font}.tar.xz) |" +done + +echo +echo "
"