diff --git a/.github/workflows/releaser.yml b/.github/workflows/releaser.yml index d0e7015560..efe5fa0fb1 100644 --- a/.github/workflows/releaser.yml +++ b/.github/workflows/releaser.yml @@ -145,6 +145,35 @@ jobs: mkdir -p build tar -czf build/thv-cli-docs.tar.gz -C docs/cli . + - name: Bundle CRD manifests + run: | + mkdir -p build + tar -czf build/thv-crds.tar.gz -C deploy/charts/operator-crds/files/crds . + + - 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 }} @@ -213,44 +242,6 @@ jobs: id-token: write uses: ./.github/workflows/helm-publish.yml - extract-release-actor: - name: Extract Release Actor - runs-on: ubuntu-slim - outputs: - triggered_by: ${{ steps.extract.outputs.triggered_by }} - permissions: - contents: read - steps: - - name: Extract actor from release body - id: extract - env: - GH_TOKEN: ${{ github.token }} - run: | - # Fetch the release body and extract the Release-Triggered-By metadata - RELEASE_BODY=$(gh release view "${{ github.ref_name }}" --repo "${{ github.repository }}" --json body --jq '.body') - - # Extract username from HTML comment: - TRIGGERED_BY=$(echo "$RELEASE_BODY" | grep -oP '(?<=)' || true) - - if [ -n "$TRIGGERED_BY" ]; then - echo "Found release triggering actor: $TRIGGERED_BY" - echo "triggered_by=$TRIGGERED_BY" >> $GITHUB_OUTPUT - else - echo "No Release-Triggered-By metadata found, falling back to github.actor" - echo "triggered_by=${{ github.actor }}" >> $GITHUB_OUTPUT - fi - - update-docs-website: - name: Trigger Docs Update - needs: [ publish-helm, extract-release-actor ] - permissions: {} - uses: ./.github/workflows/update-docs-website.yml - with: - version: ${{ github.ref_name }} - assign_to: ${{ needs.extract-release-actor.outputs.triggered_by }} - secrets: - DOCS_REPO_DISPATCH_TOKEN: ${{ secrets.DOCS_REPO_DISPATCH_TOKEN }} - # provenance: # name: Generate provenance (SLSA3) # needs: @@ -311,9 +302,7 @@ jobs: - release-binaries - image-build-and-push - skills-build-and-push - - update-docs-website - publish-helm - - extract-release-actor if: ${{ failure() }} runs-on: ubuntu-slim permissions: {} diff --git a/.github/workflows/update-docs-website.yml b/.github/workflows/update-docs-website.yml deleted file mode 100644 index c96210c009..0000000000 --- a/.github/workflows/update-docs-website.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: Trigger Docs Update - -permissions: {} - -on: - workflow_call: - inputs: - version: - description: 'Version tag for the release' - required: true - type: string - assign_to: - description: 'GitHub username to assign the PR to' - required: false - type: string - secrets: - DOCS_REPO_DISPATCH_TOKEN: - required: true - -jobs: - trigger-docs-update: - name: Trigger Documentation Update - runs-on: ubuntu-slim - - steps: - - name: Trigger docs update workflow - run: | - repo="stacklok/docs-website" - event_type="published-release" - version="${{ inputs.version }}" - assign_to="${{ inputs.assign_to }}" - - echo "Triggering docs update for $repo with version $version" - if [ -n "$assign_to" ]; then - echo "Will assign PR to: $assign_to" - fi - - # Build client_payload JSON - payload="{\"version\": \"$version\"" - if [ -n "$assign_to" ]; then - payload="$payload, \"assign_to\": \"$assign_to\"" - fi - payload="$payload}" - - curl --fail -L \ - -X POST \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ secrets.DOCS_REPO_DISPATCH_TOKEN }}" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/repos/$repo/dispatches \ - -d "{\"event_type\": \"$event_type\", \"client_payload\": $payload}" diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 6229397734..bbfbea5055 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -101,6 +101,11 @@ release: name: toolhive extra_files: - glob: build/thv-cli-docs.tar.gz + - glob: build/thv-crds.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