Skip to content

Integrate real diffenator and fontTools font metric and character map… #10

Integrate real diffenator and fontTools font metric and character map…

Integrate real diffenator and fontTools font metric and character map… #10

# Weekly Google Fonts Upstream Auto-Updater Workflow (Internal Engine)
name: Weekly Font Upstream Auto-Updater
on:
push:
branches: [auto_updater]
schedule:
- cron: '0 0 * * 0' # Runs weekly every Sunday at 00:00 UTC
workflow_dispatch:
inputs:
target_family:
description: 'Path to single METADATA.pb file (optional, e.g., ofl/inter/METADATA.pb)'
required: false
default: ''
max_families:
description: 'Maximum number of families to audit (0 for all catalog families)'
required: false
default: '0'
max_workers:
description: 'Parallel worker threads'
required: false
default: '10'
max_prs:
description: 'Maximum PRs to submit (default: 1 for first located update)'
required: false
default: '1'
base_branch:
description: 'Base branch for PR submission (default: main)'
required: false
default: 'main'
permissions:
contents: write
pull-requests: write
issues: write
jobs:
autoupdate-sweep:
name: Run Upstream Auto-Update Catalog Audit
runs-on: ubuntu-latest
steps:
- name: Checkout google/fonts Repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Cache State Database
uses: actions/cache@v3
with:
path: gf_autoupdater_state.db
key: gf-autoupdater-state-${{ github.run_id }}
restore-keys: |
gf-autoupdater-state-
- name: Install Engine Dependencies
run: |
python -m pip install --upgrade pip
pip install fontTools requests
- name: Configure Git Author Identity
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Run Upstream Update Audit Sweep & Submit PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TARGET_FAMILY="${{ github.event.inputs.target_family }}"
MAX_FAMILIES="${{ github.event.inputs.max_families || '0' }}"
MAX_WORKERS="${{ github.event.inputs.max_workers || '10' }}"
MAX_PRS="${{ github.event.inputs.max_prs || '1' }}"
BASE_BRANCH="${{ github.event.inputs.base_branch || 'main' }}"
if [ -n "$TARGET_FAMILY" ]; then
echo "Running targeted update check on: $TARGET_FAMILY (creating PR to $BASE_BRANCH)..."
PYTHONPATH=.ci python3 -m autoupdater.cli --metadata "$TARGET_FAMILY" --create-pr --base-branch "$BASE_BRANCH"
else
echo "Running full catalog update audit across $MAX_FAMILIES families ($MAX_WORKERS workers, max PRs: $MAX_PRS, base branch: $BASE_BRANCH)..."
PYTHONPATH=.ci python3 .ci/autoupdater/catalog_audit.py . "$MAX_FAMILIES" "$MAX_WORKERS" 50 "$MAX_PRS" "$BASE_BRANCH"
fi
- name: Publish Step Summary Report
if: always()
run: |
if [ -f catalog_audit_report.md ]; then
cat catalog_audit_report.md >> $GITHUB_STEP_SUMMARY
fi
- name: Upload Human-Readable Audit Artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: autoupdater-human-readable-report
path: |
catalog_audit_report.md
catalog_audit_report.csv
catalog_audit_report.json
gf_audit_progress.json
gf_catalog_full_audit.db