From bcc57e563e821509353316e1795a3032a20edd10 Mon Sep 17 00:00:00 2001 From: Bryan Kok Date: Sat, 27 Mar 2021 19:27:07 +0800 Subject: [PATCH] Generate fonts in parallel Need to checkout to call the fetch_dump.sh script --- .github/workflows/generate-fonts.yml | 141 +++++++++++++++++++++++---- 1 file changed, 123 insertions(+), 18 deletions(-) diff --git a/.github/workflows/generate-fonts.yml b/.github/workflows/generate-fonts.yml index d238d34..8386d70 100644 --- a/.github/workflows/generate-fonts.yml +++ b/.github/workflows/generate-fonts.yml @@ -9,7 +9,23 @@ on: - "testing-*" jobs: - build: + fetch_dump_and_svg_font: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: sudo apt install wget + - run: sh fetch_dump.sh + - run: sh fetch_svg_font.sh + - run: gzip -d *.txt.gz + - uses: actions/upload-artifact@master + with: + name: raw-data + path: | + ./glyphwiki_*.txt + ./glyphwiki_dump/ + + build-mincho-sc: + needs: ["fetch_dump_and_svg_font"] runs-on: ubuntu-latest continue-on-error: true env: @@ -19,7 +35,10 @@ jobs: - uses: actions/checkout@v2 with: submodules: recursive - - run: sudo apt install wget + - uses: actions/download-artifact@v2 + with: + name: raw-data + # - run: sudo apt install wget - name: Set up Python 3.9.x uses: actions/setup-python@v2 with: @@ -48,11 +67,11 @@ jobs: run: poetry install if: steps.cache.outputs.cache-hit != 'true' - - run: sh fetch_dump.sh - - run: sh fetch_svg_font.sh + # - run: sh fetch_dump.sh + # - run: sh fetch_svg_font.sh + + # - run: gzip -d *.txt.gz - - run: gzip -d *.txt.gz - # - run: sh clean.sh || exit 0 - name: Mincho SC run: | CONFIG=./config_mincho_single.json poetry run driver ./glyphwiki_dump/dump_newest_only.txt ./glyphwiki_mincho.txt ./perl-scripts g @@ -60,28 +79,83 @@ jobs: zip HanaMinLiteSC.zip {Hana*.!(*@(otf|zip)),GlyphWiki*} rm {Hana*.!(*@(otf|zip)),GlyphWiki*} - # - run: sh clean.sh || exit 0 - - name: Mincho TC CJK + - name: Mincho CJK SC run: | - CONFIG=./config_mincho.json poetry run driver ./glyphwiki_dump/dump_newest_only.txt ./glyphwiki_mincho.txt ./perl-scripts t + CONFIG=./config_mincho.json poetry run driver ./glyphwiki_dump/dump_newest_only.txt ./glyphwiki_mincho.txt ./perl-scripts g shopt -s extglob - zip HanaMinLiteCJKTC.zip {Hana*.!(*@(otf|zip)),GlyphWiki*} + zip HanaMinLiteCJKSC.zip {Hana*.!(*@(otf|zip)),GlyphWiki*} rm {Hana*.!(*@(otf|zip)),GlyphWiki*} - # - run: sh clean.sh || exit 0 - - name: Gothic JP + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: | + *.otf + *.zip + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + build-mincho-tc: + needs: ["fetch_dump_and_svg_font"] + runs-on: ubuntu-latest + continue-on-error: true + env: + TEST_RUN: true + + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - uses: actions/download-artifact@v2 + with: + name: raw-data + # - run: sudo apt install wget + - name: Set up Python 3.9.x + uses: actions/setup-python@v2 + with: + python-version: 3.9.x + - uses: shogo82148/actions-setup-perl@v1 + with: + perl-version: "5.32" + - name: Install Poetry + uses: snok/install-poetry@v1.1.1 + + - name: Cache Poetry virtualenv + uses: actions/cache@v1 + id: cache + with: + path: ~/.virtualenvs + key: poetry-${{ hashFiles('**/poetry.lock') }} + restore-keys: | + poetry-${{ hashFiles('**/poetry.lock') }} + + - name: Set Poetry config + run: | + poetry config virtualenvs.in-project false + poetry config virtualenvs.path ~/.virtualenvs + + - name: Install Dependencies + run: poetry install + if: steps.cache.outputs.cache-hit != 'true' + + # - run: sh fetch_dump.sh + # - run: sh fetch_svg_font.sh + + # - run: gzip -d *.txt.gz + + - name: Mincho TC run: | - CONFIG=./config_gothic_single.json poetry run driver ./glyphwiki_dump/dump_newest_only.txt ./glyphwiki_gothic.txt ./perl-scripts j + CONFIG=./config_mincho_single.json poetry run driver ./glyphwiki_dump/dump_newest_only.txt ./glyphwiki_mincho.txt ./perl-scripts t shopt -s extglob - zip HanaGothLiteJP.zip {Hana*.!(*@(otf|zip)),GlyphWiki*} + zip HanaMinLiteTC.zip {Hana*.!(*@(otf|zip)),GlyphWiki*} rm {Hana*.!(*@(otf|zip)),GlyphWiki*} - # - run: sh clean.sh || exit 0 - - name: Gothic KR CJK + - name: Mincho CJK TC run: | - CONFIG=./config_gothic.json poetry run driver ./glyphwiki_dump/dump_newest_only.txt ./glyphwiki_mincho.txt ./perl-scripts t + CONFIG=./config_mincho.json poetry run driver ./glyphwiki_dump/dump_newest_only.txt ./glyphwiki_mincho.txt ./perl-scripts t shopt -s extglob - zip HanaGothLiteCJKKR.zip {Hana*.!(*@(otf|zip)),GlyphWiki*} + zip HanaMinLiteCJKTC.zip {Hana*.!(*@(otf|zip)),GlyphWiki*} rm {Hana*.!(*@(otf|zip)),GlyphWiki*} - name: Release @@ -93,3 +167,34 @@ jobs: *.zip env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # - name: Mincho TC CJK + # run: | + # CONFIG=./config_mincho.json poetry run driver ./glyphwiki_dump/dump_newest_only.txt ./glyphwiki_mincho.txt ./perl-scripts t + # shopt -s extglob + # zip HanaMinLiteCJKTC.zip {Hana*.!(*@(otf|zip)),GlyphWiki*} + # rm {Hana*.!(*@(otf|zip)),GlyphWiki*} + + # - name: Gothic JP + # run: | + # CONFIG=./config_gothic_single.json poetry run driver ./glyphwiki_dump/dump_newest_only.txt ./glyphwiki_gothic.txt ./perl-scripts j + # shopt -s extglob + # zip HanaGothLiteJP.zip {Hana*.!(*@(otf|zip)),GlyphWiki*} + # rm {Hana*.!(*@(otf|zip)),GlyphWiki*} + + # - name: Gothic KR CJK + # run: | + # CONFIG=./config_gothic.json poetry run driver ./glyphwiki_dump/dump_newest_only.txt ./glyphwiki_mincho.txt ./perl-scripts t + # shopt -s extglob + # zip HanaGothLiteCJKKR.zip {Hana*.!(*@(otf|zip)),GlyphWiki*} + # rm {Hana*.!(*@(otf|zip)),GlyphWiki*} + + # - name: Release + # uses: softprops/action-gh-release@v1 + # if: startsWith(github.ref, 'refs/tags/') + # with: + # files: | + # *.otf + # *.zip + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}