diff --git a/.github/workflows/releaser.yml b/.github/workflows/releaser.yml index d0e7015560..514156f3b8 100644 --- a/.github/workflows/releaser.yml +++ b/.github/workflows/releaser.yml @@ -145,6 +145,30 @@ jobs: mkdir -p build tar -czf build/thv-cli-docs.tar.gz -C docs/cli . + - name: Download toolhive-core schemas at pinned version + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + # Resolve the toolhive-core version this release was built against + # (from go.mod, since we ship binaries compiled against that version). + # Re-exporting the schemas here lets downstream consumers (notably + # docs-website) skip the two-repo dance of deriving the version and + # fetching from a separate release. + mkdir -p build + CORE_VERSION=$(grep 'github.com/stacklok/toolhive-core' go.mod | awk '{print $2}' | head -1) + if [ -z "$CORE_VERSION" ]; then + echo "::error::Could not determine toolhive-core version from go.mod" + exit 1 + fi + echo "Using toolhive-core version: $CORE_VERSION" + gh release download "$CORE_VERSION" \ + --repo stacklok/toolhive-core \ + --pattern "toolhive-legacy-registry.schema.json" \ + --pattern "upstream-registry.schema.json" \ + --pattern "publisher-provided.schema.json" \ + --pattern "skill.schema.json" \ + --dir build/ + - name: Remove existing release assets (allows re-runs) env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 6229397734..8d27ba809b 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -101,6 +101,10 @@ release: name: toolhive extra_files: - glob: build/thv-cli-docs.tar.gz + - glob: build/toolhive-legacy-registry.schema.json + - glob: build/upstream-registry.schema.json + - glob: build/publisher-provided.schema.json + - glob: build/skill.schema.json - glob: docs/server/swagger.yaml - glob: docs/server/swagger.json - glob: docs/operator/crd-api.md