Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release master fontpatcher #1044

Merged
merged 7 commits into from
Feb 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/zip-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Create FontPatcher.zip

on:
push:
branches: master
paths:
- font-patcher
- src/glyphs/**
- src/archive-font-patcher-readme.me
- bin/scripts/archive-font-patcher.sh
- bin/scripts/name_parser/Fontname*.py
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Fetch dependencies
run: sudo apt install -y -q zipcmp

- name: Create archive
run: |
chmod u+x font-patcher bin/scripts/archive-font-patcher.sh
cd bin/scripts
./archive-font-patcher.sh intermediate
- name: Upload archive as artifact
uses: actions/upload-artifact@v3
with:
path: archives/FontPatcher.zip
retention-days: 1

- name: Check if archive contents changed
id: updated-or-not
run: |
(zipcmp archives/FontPatcher.zip ./FontPatcher.zip; \
echo "updated=$?" >> $GITHUB_OUTPUT) || true
- name: Prepare commit
if: steps.updated-or-not.outputs.updated != 0
run: cp -f archives/FontPatcher.zip .

- name: Commit new archive
uses: EndBug/add-and-commit@v9
if: steps.updated-or-not.outputs.updated != 0
with:
fetch: false
add: "FontPatcher.zip"
message: "[ci] Update FontPatcher.zip"
committer_name: GitHub Actions
committer_email: 41898282+github-actions[bot]@users.noreply.github.com
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