From 32d523622ea7dd4e27fccaed56d577eb38347429 Mon Sep 17 00:00:00 2001 From: StuBehan Date: Thu, 30 Apr 2026 23:54:11 +0200 Subject: [PATCH] fix(ci): filter Kokoro release check to releases with general assets The original tag-name-only filter shipped in #24 would have flagged `model-files-v1.1` as an upgrade candidate even though that release ships only a Mandarin variant (`kokoro-v1.1-zh.onnx` / `voices-v1.1-zh.bin`). Bumping engine.py URLs to it would silently swap the multilingual model for a Chinese-focused one. Tightens the jq filter to require both `kokoro-vX.Y.onnx` and `voices-vX.Y.bin` assets to be present in the release before treating it as a successor. With this in place the workflow currently resolves `model-files-v1.0` (== pinned) and reports up-to-date, as it should. A future general release (with non-suffixed asset names) will surface correctly. This was meant to land as a follow-up commit on #24 but the squash merge captured only the first commit on that branch. Filing as its own PR. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/check-kokoro-model.yml | 28 +++++++++++++++++++----- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/.github/workflows/check-kokoro-model.yml b/.github/workflows/check-kokoro-model.yml index dfbcbf2..c8fd743 100644 --- a/.github/workflows/check-kokoro-model.yml +++ b/.github/workflows/check-kokoro-model.yml @@ -46,17 +46,33 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - # Filter to model-files-v* tags so the kokoro_onnx Python package - # releases (which use plain v* tags) don't confuse us. - tag=$(gh api repos/thewh1teagle/kokoro-onnx/releases \ - --jq '[.[] | select(.tag_name | startswith("model-files-v"))][0].tag_name') + # Two filters here, both essential: + # + # 1. tag_name starts with `model-files-v` — kokoro-onnx also + # publishes plain `v*` tags for the Python package; we don't + # care about those. + # + # 2. release contains BOTH `kokoro-vX.Y.onnx` AND `voices-vX.Y.bin` + # assets (no variant suffix). This skips Mandarin-only sibling + # releases like `model-files-v1.1` whose assets are + # `kokoro-v1.1-zh.onnx` / `voices-v1.1-zh.bin` — a tag-only + # check would treat that as a successor and prompt a broken + # URL bump. + tag=$(gh api repos/thewh1teagle/kokoro-onnx/releases --jq ' + [ + .[] + | select(.tag_name | startswith("model-files-v")) + | select([.assets[] | .name | test("^kokoro-v[0-9.]+\\.onnx$")] | any) + | select([.assets[] | .name | test("^voices-v[0-9.]+\\.bin$")] | any) + ][0].tag_name + ') if [ -z "$tag" ] || [ "$tag" = "null" ]; then - echo "::warning::could not resolve latest upstream model-files-v* tag; skipping" + echo "::warning::could not resolve latest upstream model-files-v* tag with general (non-variant) assets; skipping" echo "tag=" >> "$GITHUB_OUTPUT" exit 0 fi echo "tag=$tag" >> "$GITHUB_OUTPUT" - echo "latest upstream tag: $tag" + echo "latest upstream tag (with general assets): $tag" - name: ensure model-upgrade label exists if: steps.latest.outputs.tag != '' && steps.latest.outputs.tag != steps.pinned.outputs.tag