Fixes use of archive, archive patcher and cleanup

This commit is contained in:
Ryan L McIntyre 2022-01-03 00:53:22 -08:00
parent 2f429c8fac
commit e630dd1697
2 changed files with 50 additions and 12 deletions

View file

@ -138,12 +138,10 @@ jobs:
./generate-fontconfig.sh
./generate-casks.sh "${{ matrix.font }}"
# - uses: EndBug/add-and-commit@v7
# with:
# add: 'patched-fonts'
# message: Rebuilds patched fonts
# committer_name: GitHub Actions
# committer_email: 41898282+github-actions[bot]@users.noreply.github.com
- name: Archive font-patcher script for release
run: |
cd -- "$GITHUB_WORKSPACE/bin/scripts"
./archive-font-patcher.sh
- name: Archive font package zip files and upload for release
run: |
@ -155,9 +153,11 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: patched-fonts
# adding multiple paths (i.e. LICENSE) is a workaround to get a least common ancestor
# of the root directory for artifact path purposes
path: |
"$GITHUB_WORKSPACE/patched-fonts/${{ matrix.font }}/"
"$GITHUB_WORKSPACE/LICENSE"
patched-fonts/${{ matrix.font }}
LICENSE
commit:
name: Commit and push patched fonts to the repo
@ -167,13 +167,11 @@ jobs:
- uses: actions/checkout@v2
- name: Download patched fonts from build
id: download-patched-fonts
uses: actions/download-artifact@v2
with:
name: patched-fonts
path: "$GITHUB_WORKSPACE/patched-fonts/"
- name: Display structure of downloaded files
run: ls -R
path: .
# uncommment once structure is correct
# - uses: EndBug/add-and-commit@v7

View file

@ -0,0 +1,40 @@
#!/usr/bin/env bash
# Nerd Fonts Version: 2.1.0
# Script Version: 1.0.0
# Archives the font patcher script and the required source files
# used for debugging
# set -x
# LINE_PREFIX="# [Nerd Fonts]"
scripts_root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/"
parent_dir="${PWD}/../../"
outputdir=$scripts_root_dir../../archives
mkdir -p "$outputdir"
# create a mini readme with basic info on Nerd Fonts project
touch "$outputdir/readme.md"
mini_readme="$outputdir/readme.md"
cat "$parent_dir/src/archive-font-patcher-readme.md" >> "$mini_readme"
# 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 "font-patcher" | zip -9 "$outputdir/FontPatcher" -@
# add mini readme file
zip -9 "$outputdir/FontPatcher" -rj "$mini_readme" -q
rm -f "$mini_readme"
# @TODO check zip status
# zipStatus=$?
# if [ "$zipStatus" != "0" ]
# then
# echo "$LINE_PREFIX error, font-patcher archive not created"
# exit 1
# else
# echo "$LINE_PREFIX font-patcher archive created successfully"
# fi;