Skip to content

Font Build + Patch to Repository Release #44

Font Build + Patch to Repository Release

Font Build + Patch to Repository Release #44

name: Font Build + Patch to Repository Release
on:
workflow_dispatch:
jobs:
font-build-patch:
name: Font Build + Patch | Iosevka & Nerd Fonts
runs-on: ubuntu-latest
steps:
- name: Step 1 | Setup Node.js
uses: actions/setup-node@v4
- name: Step 2 | Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
# NOTE: Reference for repository to use for installing FontForge: https://askubuntu.com/questions/1058055/how-do-i-install-fontforge-on-kubuntu-18-04
- name: Step 3 | Setup FontForge
run: |
sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install fontforge python3-fontforge
- name: Step 4 | Main Repository Checkout
uses: actions/checkout@v4
with:
sparse-checkout: |
font/private-build-plans.toml
sparse-checkout-cone-mode: false
- name: Step 5 | Font (Iosevka) Repository Checkout
uses: actions/checkout@v4
with:
path: font-build
repository: be5invis/Iosevka
fetch-depth: 1
- name: Step 6 | Install Iosevka Dependencies
working-directory: font-build
run: |
npm install
npm install ttfautohint
- name: Step 7 | Font Patcher Repository Checkout
uses: actions/checkout@v4
with:
path: font-patch
repository: ryanoasis/nerd-fonts
sparse-checkout: |
bin
src/glyphs
font-patcher
sparse-checkout-cone-mode: false
- name: Step 8.A | Pre-Build Font (Prep-work)
working-directory: font-build
run: |
mv ../font/private-build-plans.toml ./
- name: Step 8.B | Actual Build Font
working-directory: font-build
run: |
npm run build -- ttf::IosevkaCodexLink
- name: Step 8.C | Post-Build Font (Clean-up)
working-directory: font-build
run: |
mv ./dist/IosevkaCodexLink/TTF/ ../font-patch/font-dist-ttf
mkdir ../font-patch/font-dist-ttf/original
mkdir ../font-patch/font-dist-ttf/patched
mv ../font-patch/font-dist-ttf/*.ttf ../font-patch/font-dist-ttf/original
# NOTE: Reference for fix in regards to missing Base Library: https://github.com/indygreg/PyOxidizer/issues/406
- name: Step 9 | Actual Patch Font
working-directory: font-patch
shell: bash
run: |
unset LD_LIBRARY_PATH
for i in font-dist-ttf/original/*.ttf; do fontforge -script ./font-patcher $i --complete --mono --no-progressbars --outputdir font-dist-ttf/patched --quiet; done
mv font-dist-ttf ../font-dist
- name: Step 10 | Pre-Commit to Repository (Invoke Date to Commit Message)
id: ACTION__DT_EXEC
run: |
echo "ACTION__DT_EXEC_OUT=$(date + %m%d%Y_%H%M%S)" >> "$GITHUB_OUTPUT"
- name: Step 9.B | Actual Commit to Repository
uses: EndBug/add-and-commit@v9
env:
ACTION__DT_EXEC_REF: ${{ steps.ACTION__DT_EXEC.outputs.ACTION__DT_EXEC_OUT }}
with:
committer_name: GitHub Actions
committer_email: actions@github.com
message: "chore(font): font build and patched since $ACTION__DT_EXEC_REF"
add: "font-dist/**"