Skip to content

catalog-refresh

catalog-refresh #6

name: catalog-refresh
# Re-runs `tools/catalog/build_catalog.py` once a week and commits the new
# `catalog/v1/models.json` directly to main when it changes. The script
# discovers every voice on the upstream sherpa-onnx TTS model index and
# computes a sha256 over each release tarball — so when k2-fsa publishes new
# voices or rebuilds an existing one, HayaiTTS sees it within a week without
# anyone touching the repo by hand.
#
# We commit straight to main rather than opening a PR: the work is fully
# deterministic, every voice change is captured in the workflow log, and
# there's no human review value in approving 188 sha256 strings.
on:
schedule:
# 06:30 UTC every Monday. Off-peak for GitHub Actions queues.
- cron: '30 6 * * 1'
workflow_dispatch: {}
permissions:
contents: write
jobs:
refresh:
# Bandwidth-bound (~10 GB streamed across ~190 bundles). Blacksmith's
# faster CPUs gain us nothing here, so stay on GitHub-hosted runners to
# save Blacksmith minutes for the build workflows.
runs-on: ubuntu-latest
# Generator streams ~5–10 GB across 180+ bundles; allow a generous wall.
timeout-minutes: 120
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install generator dependencies
run: pip install -r tools/catalog/requirements.txt
- name: Regenerate catalog
run: python tools/catalog/build_catalog.py --output catalog/v1/models.json
- name: Commit + push if changed
run: |
set -euo pipefail
if git diff --quiet --exit-code catalog/v1/models.json; then
echo "Catalog is identical to upstream — nothing to commit."
exit 0
fi
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
# Count voices for the commit message — a quick at-a-glance audit
# of catalog churn from `git log catalog/v1/models.json`.
count=$(python -c "import json; print(len(json.load(open('catalog/v1/models.json'))['voices']))")
git add catalog/v1/models.json
git commit -m "Refresh catalog from upstream sherpa-onnx index ($count voices)"
git push origin HEAD:main