Skip to content

Commit

Permalink
archive-font-patcher: Include version in readme
Browse files Browse the repository at this point in the history
[why]
If we create the zip file not only on releases we need some better
version information inside.

We can not use the same approach with real releases, because we add the
tag at a later stage in the workflow.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
  • Loading branch information
Finii committed Feb 17, 2023
1 parent 8495438 commit 02f807e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/zip-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
run: |
chmod u+x font-patcher bin/scripts/archive-font-patcher.sh
cd bin/scripts
./archive-font-patcher.sh
./archive-font-patcher.sh intermediate
- name: Upload archive as artifact
uses: actions/upload-artifact@v3
Expand Down
12 changes: 9 additions & 3 deletions bin/scripts/archive-font-patcher.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env bash
# Nerd Fonts Version: 2.3.3
# Script Version: 1.0.0
# Script Version: 1.1.0
# Archives the font patcher script and the required source files
# If some (any) argument is given this is though of as intermediate version
# used for debugging
# set -x

Expand All @@ -16,14 +17,19 @@ mkdir -p "$outputdir"
touch "$outputdir/readme.md"
mini_readme="$outputdir/readme.md"
cat "$parent_dir/src/archive-font-patcher-readme.md" >> "$mini_readme"
if [ $# -ge 1 ]; then
echo "Intemediate version, adding git version"
echo -e "\n## Version\n" >> "$mini_readme"
echo "This archive is created from $(git describe --tags --dirty)" >> "$mini_readme"
fi

# clear out the directory zips
find "${outputdir:?}" -name "FontPatcher.zip" -type f -delete

cd -- "$scripts_root_dir/../../" || exit 1
find "src/glyphs" | zip -9 "$outputdir/FontPatcher" -@
find "src/glyphs" | zip -9 "$outputdir/FontPatcher" -@
find "bin/scripts/name_parser" -name "Fontname*.py" | zip -9 "$outputdir/FontPatcher" -@
find "font-patcher" | zip -9 "$outputdir/FontPatcher" -@
find "font-patcher" | zip -9 "$outputdir/FontPatcher" -@

# add mini readme file
zip -9 "$outputdir/FontPatcher" -rj "$mini_readme" -q
Expand Down

0 comments on commit 02f807e

Please sign in to comment.