Skip to content

Commit 7ee0772

Browse files
rdimitrovclaude
andauthored
Unify docs-website release pipeline: new assets + retire dispatch chain (#4982)
* Bundle CRD manifests as a release asset Adds a `thv-crds.tar.gz` tarball to each release containing the CRD YAML manifests from `deploy/charts/operator-crds/files/crds/`. Motivation: downstream consumers of the CRDs (notably stacklok/docs-website, which generates per-CRD reference pages) currently have to clone the entire toolhive repo at each release tag just to read these 13 manifests. Shipping them as a ~94KB tarball asset lets those consumers skip the clone and just `gh release download` like they already do for `thv-cli-docs.tar.gz` and `swagger.yaml`. Purely additive — no changes to existing release assets or workflows. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Re-export toolhive-core schemas as release assets Reads the toolhive-core version from go.mod at release time, downloads the four JSON schema files from that version of stacklok/toolhive-core, and ships them alongside toolhive's own release assets. Motivation: downstream consumers (notably stacklok/docs-website) currently have to replicate this logic: read go.mod, derive the core version, then fetch from a different repo's release. Re-exporting the schemas here makes toolhive's release self-contained — one `gh release download` call gets everything. Paired with #4982 (CRD manifests as release asset); together these eliminate the need for docs-website to clone toolhive or hit a second repo during its release-doc regeneration. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Retire the docs-website repository_dispatch chain docs-website no longer consumes `repository_dispatch: published-release` events — its reference-doc regeneration now runs via a Renovate-driven pipeline that reads the new `thv-crds.tar.gz` and re-exported core schemas introduced earlier in this PR. See stacklok/docs-website#748 for context. Changes: - Delete `.github/workflows/update-docs-website.yml` (the dispatch sender, called via workflow_call from `releaser.yml`). - Remove the `update-docs-website` job from `releaser.yml` along with its `extract-release-actor` dependency, which only existed to feed the dispatch's `assign_to` input. - Update `notify-release-failure`'s `needs:` list to drop the removed jobs. Follow-up for maintainers: the `DOCS_REPO_DISPATCH_TOKEN` repo secret can be retired — nothing references it after this change. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 63ee62a commit 7ee0772

3 files changed

Lines changed: 34 additions & 91 deletions

File tree

.github/workflows/releaser.yml

Lines changed: 29 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,35 @@ jobs:
145145
mkdir -p build
146146
tar -czf build/thv-cli-docs.tar.gz -C docs/cli .
147147
148+
- name: Bundle CRD manifests
149+
run: |
150+
mkdir -p build
151+
tar -czf build/thv-crds.tar.gz -C deploy/charts/operator-crds/files/crds .
152+
153+
- name: Download toolhive-core schemas at pinned version
154+
env:
155+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
156+
run: |
157+
# Resolve the toolhive-core version this release was built against
158+
# (from go.mod, since we ship binaries compiled against that version).
159+
# Re-exporting the schemas here lets downstream consumers (notably
160+
# docs-website) skip the two-repo dance of deriving the version and
161+
# fetching from a separate release.
162+
mkdir -p build
163+
CORE_VERSION=$(grep 'github.com/stacklok/toolhive-core' go.mod | awk '{print $2}' | head -1)
164+
if [ -z "$CORE_VERSION" ]; then
165+
echo "::error::Could not determine toolhive-core version from go.mod"
166+
exit 1
167+
fi
168+
echo "Using toolhive-core version: $CORE_VERSION"
169+
gh release download "$CORE_VERSION" \
170+
--repo stacklok/toolhive-core \
171+
--pattern "toolhive-legacy-registry.schema.json" \
172+
--pattern "upstream-registry.schema.json" \
173+
--pattern "publisher-provided.schema.json" \
174+
--pattern "skill.schema.json" \
175+
--dir build/
176+
148177
- name: Remove existing release assets (allows re-runs)
149178
env:
150179
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -213,44 +242,6 @@ jobs:
213242
id-token: write
214243
uses: ./.github/workflows/helm-publish.yml
215244

216-
extract-release-actor:
217-
name: Extract Release Actor
218-
runs-on: ubuntu-slim
219-
outputs:
220-
triggered_by: ${{ steps.extract.outputs.triggered_by }}
221-
permissions:
222-
contents: read
223-
steps:
224-
- name: Extract actor from release body
225-
id: extract
226-
env:
227-
GH_TOKEN: ${{ github.token }}
228-
run: |
229-
# Fetch the release body and extract the Release-Triggered-By metadata
230-
RELEASE_BODY=$(gh release view "${{ github.ref_name }}" --repo "${{ github.repository }}" --json body --jq '.body')
231-
232-
# Extract username from HTML comment: <!-- Release-Triggered-By: username -->
233-
TRIGGERED_BY=$(echo "$RELEASE_BODY" | grep -oP '(?<=<!-- Release-Triggered-By: )[^[:space:]]+(?= -->)' || true)
234-
235-
if [ -n "$TRIGGERED_BY" ]; then
236-
echo "Found release triggering actor: $TRIGGERED_BY"
237-
echo "triggered_by=$TRIGGERED_BY" >> $GITHUB_OUTPUT
238-
else
239-
echo "No Release-Triggered-By metadata found, falling back to github.actor"
240-
echo "triggered_by=${{ github.actor }}" >> $GITHUB_OUTPUT
241-
fi
242-
243-
update-docs-website:
244-
name: Trigger Docs Update
245-
needs: [ publish-helm, extract-release-actor ]
246-
permissions: {}
247-
uses: ./.github/workflows/update-docs-website.yml
248-
with:
249-
version: ${{ github.ref_name }}
250-
assign_to: ${{ needs.extract-release-actor.outputs.triggered_by }}
251-
secrets:
252-
DOCS_REPO_DISPATCH_TOKEN: ${{ secrets.DOCS_REPO_DISPATCH_TOKEN }}
253-
254245
# provenance:
255246
# name: Generate provenance (SLSA3)
256247
# needs:
@@ -311,9 +302,7 @@ jobs:
311302
- release-binaries
312303
- image-build-and-push
313304
- skills-build-and-push
314-
- update-docs-website
315305
- publish-helm
316-
- extract-release-actor
317306
if: ${{ failure() }}
318307
runs-on: ubuntu-slim
319308
permissions: {}

.github/workflows/update-docs-website.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

.goreleaser.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ release:
101101
name: toolhive
102102
extra_files:
103103
- glob: build/thv-cli-docs.tar.gz
104+
- glob: build/thv-crds.tar.gz
105+
- glob: build/toolhive-legacy-registry.schema.json
106+
- glob: build/upstream-registry.schema.json
107+
- glob: build/publisher-provided.schema.json
108+
- glob: build/skill.schema.json
104109
- glob: docs/server/swagger.yaml
105110
- glob: docs/server/swagger.json
106111
- glob: docs/operator/crd-api.md

0 commit comments

Comments
 (0)