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