From eae22e5af56959c567875cf18f44b45f52979813 Mon Sep 17 00:00:00 2001 From: bd_ Date: Thu, 14 Mar 2024 18:54:20 +0900 Subject: [PATCH] ci-test --- .github/workflows/strip-font-data.yml | 38 +++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/strip-font-data.yml diff --git a/.github/workflows/strip-font-data.yml b/.github/workflows/strip-font-data.yml new file mode 100644 index 00000000..8227eab5 --- /dev/null +++ b/.github/workflows/strip-font-data.yml @@ -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 -pe '$s = undefined if ($s && /^$s[a-z]/); $s = $1 if /^( +)(m_GlyphTable:|m_FreeGlyphRects:|m_CharacterTable:); print if not $s;' \ + > "$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 + \ No newline at end of file