From 0305392c4fca77cbc94472298f9d844f1ad11b18 Mon Sep 17 00:00:00 2001 From: Lanyi Date: Sun, 20 Aug 2023 16:59:33 +0800 Subject: [PATCH] Automatically build fonts on Github Actions (#10) * Create .github/workflows/python-app.yml (#1) * Update python-app.yml (#2) * Update python-app.yml * Update python-app.yml * Update python-app.yml * Update python-app.yml * Upload build font from Github Actions --- .github/workflows/python-app.yml | 64 ++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .github/workflows/python-app.yml diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml new file mode 100644 index 0000000..7e0f6b5 --- /dev/null +++ b/.github/workflows/python-app.yml @@ -0,0 +1,64 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: Python application + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +permissions: + contents: read + +jobs: + build: + + runs-on: macos-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + cache: 'pip' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Build font + run: | + # python + pip install -r requirements.txt + + # # otfcc + # # Install Xcode by mas-cli + # mas install 497799835 + # # Note: Xcode initially gets an error because the [Command line Tools:] list box is blank. + # # The following solutions will fix this problem. + # # Refer to [エラー:xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance](https://qiita.com/eytyet/items/59c5bad1c167d5addc68) + + # Install otfcc + brew tap caryll/tap + brew install otfcc-mac64 + + # Making a homograph dictionary + echo "Making a homograph dictionary" + pushd res/phonics/duo_yin_zi/scripts/ + python make_pattern_table.py + popd + + # Make an unicode table of target Chinese characters + echo "Make an unicode table of target Chinese characters" + pushd res/phonics/unicode_mapping_table/ + python make_unicode_pinyin_map_table.py + popd + + time python src/main.py --style han_serif + - name: Upload built font + uses: actions/upload-artifact@v3.1.2 + with: + path: outputs