generated from vrchat-community/template-package
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ed6a6fa
commit 6a72bd0
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||