Skip to content

Commit

Permalink
ci-test
Browse files Browse the repository at this point in the history
  • Loading branch information
bdunderscore committed Mar 14, 2024
1 parent ed6a6fa commit 6a72bd0
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/strip-font-data.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Strip unnecessary SDF font data

on:
push:
branches:
- ci
- font-packs

permissions:
contents: write

jobs:
check_and_strip_font_data:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- run: |
for font in $(find Editor/Fonts -name "*.asset"); do
echo "Processing $font..."
cat "$font" | \
grep -v "^ *_typelessdata: " | \
perl -ne '$s = undefined if ($s && /^$s[a-z]/); $s = $1 if /^( +)(m_GlyphTable:|m_FreeGlyphRects:|m_CharacterTable:)/; print if not $s;' \
"$font" > "$font.tmp"
mv "$font" "$font.tmp"
done
- name: Check if changes need committing
run: |
git config --global user.email "ci@nadena.dev"
git config --global user.name "Nadena.dev CI"
if ! git diff-index --quiet --cached HEAD --; then
git add .
git commit -m "Strip unnecessary SDF font data"
git push
fi

0 comments on commit 6a72bd0

Please sign in to comment.