ci-test #10
Workflow file for this run
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
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]/); if (/^( +)(m_GlyphTable:|m_FreeGlyphRects:|m_CharacterTable:)/) { $s = $1; print "$1$2 []\n" }; print if not $s;' \ | |
"$font" > "$font.tmp" | |
mv "$font.tmp" "$font" -fv | |
done | |
- name: git diff | |
run: git diff | |
- 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-files --quiet; then | |
git add . | |
git commit -m "Strip unnecessary SDF font data" | |
git push | |
fi | |