Skip to content

chore: clean up local-only docs #3

chore: clean up local-only docs

chore: clean up local-only docs #3

Workflow file for this run

name: build
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# starter is the v0.3 release subset with strict missing-char gate.
# gb2312-level1 is the v0.4-alpha smoke build; it just needs to finish
# and produce a readable font — visual quality is a separate manual gate.
build_mode: [starter, gb2312-level1]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
# weasyprint is only needed for local print-proof; CI skips it.
# Pillow is needed by scripts/compare_to.py (similarity gate).
python -m pip install "fonttools[woff]>=4.50.0" "brotli>=1.1.0" "Pillow>=10.0"
- name: Fetch source font
run: python scripts/fetch_base_font.py
- name: Build font (${{ matrix.build_mode }})
env:
LUO_BUILD_CHARS: ${{ matrix.build_mode }}
run: python scripts/build.py
- name: Verify font tables
run: |
python -m fontTools.ttx -l dist/Luo-Regular.ttf
python -m fontTools.ttx -l dist/Luo-Regular.woff2
- name: Health check
env:
LUO_BUILD_CHARS: ${{ matrix.build_mode }}
run: python scripts/ci_health_check.py
# Source similarity is advisory: private references are unavailable on
# CI runners, so the script runs in source-only single-target mode here.
# Local devs can opt into private reports with LUO_PRIVATE_KAI_REF on
# their own machine.
- name: Source similarity (advisory)
env:
LUO_BUILD_CHARS: ${{ matrix.build_mode }}
run: |
# Re-build starter for the 30-char anchor compare; gb2312-level1 has
# the same anchors so we only need to compare in starter mode.
if [ "$LUO_BUILD_CHARS" = "starter" ]; then
python scripts/compare_to.py --target source --no-images || true
cat proof/similarity_lxgw.json | python -c "import json,sys; r=json.load(sys.stdin); print(f'lxgw raw mean = {r[\"avg_raster_iou\"]}, centered mean = {r[\"avg_bbox_centered_iou\"]}')"
fi
- name: Upload built font
uses: actions/upload-artifact@v4
with:
name: luo-${{ matrix.build_mode }}
path: |
dist/Luo-Regular.ttf
dist/Luo-Regular.woff2
if-no-files-found: error
retention-days: 7