From 8bf4ffc4d4cafe1166d6d3f69feb7cfa551633c7 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 25 Sep 2026 00:29:53 +0000 Subject: [PATCH] ci: build chumbucket from docgen and purge bundles on docgen updates docgen replaced docparse with a tree-sitter based parser and fixed the created/last updated dates picked up by the walker, but no chumbucket release has been published for it. The pinned cb-0.4.3 binary also fails on current sources, so every scheduled run since has failed. - Build chumbucket from a pinned docgen commit (DOCGEN_REF) - Record the docgen commit in bundles/.docgen and purge all bundles and the index when it changes, so they are regenerated from scratch instead of continuing from bundles made by the old parser - Add a purge input to manual workflow runs - Bump actions/checkout to v4 and grant contents: write for the push Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01G58BnU1wSW5boKd7VouCRy --- .github/workflows/documentation.yml | 55 ++++++++++++++++++++++++----- README.md | 2 ++ trigger.txt | 1 + 3 files changed, 49 insertions(+), 9 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 05a48e2..3cb4799 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -2,6 +2,11 @@ name: Documentation on: workflow_dispatch: + inputs: + purge: + description: "Purge existing bundles and regenerate from scratch" + type: boolean + default: false schedule: # Run once every week on Sunday - cron: 0 0 * * 0 @@ -12,6 +17,14 @@ on: # Manual trigger - 'trigger.txt' +env: + # sourcemod-dev/docgen commit chumbucket is built from + # Bundles are purged and regenerated from scratch whenever this changes + DOCGEN_REF: "e3b1c42c2e834b0e7ecc6102ecf2e419cca56c40" + +permissions: + contents: write + jobs: documentation: name: Build Documentations @@ -20,26 +33,50 @@ jobs: steps: - name: Checkout manifests - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: ref: "master" path: "manifests" - name: Checkout bundles - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: ref: "bundles" path: "bundles" - - name: Download Chumbucket - uses: dsaltares/fetch-gh-release-asset@master + - name: Checkout docgen + uses: actions/checkout@v4 + with: + repository: "sourcemod-dev/docgen" + ref: ${{ env.DOCGEN_REF }} + path: "docgen" + persist-credentials: false + + - name: Install Rust stable + uses: dtolnay/rust-toolchain@stable + + - name: Cache cargo + uses: Swatinem/rust-cache@v2 with: - repo: "sourcemod-dev/docgen" - version: "tags/cb-0.4.3" - file: "chumbucket" + workspaces: "docgen" + + - name: Build Chumbucket + working-directory: docgen + run: | + cargo build --release --locked -p chumbucket + cp target/release/chumbucket ../chumbucket + + - name: Purge bundles + env: + PURGE: ${{ inputs.purge }} + run: | + # Bundles from an older docgen are not continued from, as their history and dates may differ + if [ "$PURGE" = "true" ] || [ "$(cat bundles/.docgen 2>/dev/null)" != "$DOCGEN_REF" ]; then + echo "Purging existing bundles" + rm -f bundles/*.bundle bundles/index + fi - - name: Chumbucket +x - run: sudo chmod +x chumbucket + echo "$DOCGEN_REF" > bundles/.docgen - name: Process manifests run: | diff --git a/README.md b/README.md index ec2e666..233fc25 100644 --- a/README.md +++ b/README.md @@ -27,3 +27,5 @@ patterns = [ All the manifest files are processed by the documentation generator via cron (every Sunday) or file trigger. Manifest files are processed and converted to bundle files in the `bundles` branch that will be consumed by the CDN + +`chumbucket` is built from the [docgen](https://github.com/sourcemod-dev/docgen) commit pinned by `DOCGEN_REF` in the documentation workflow. Changing that commit purges the existing bundles and regenerates them from scratch. A purge can also be requested by running the workflow manually with the `purge` input. diff --git a/trigger.txt b/trigger.txt index 73127fa..077ac4a 100644 --- a/trigger.txt +++ b/trigger.txt @@ -8,3 +8,4 @@ more metadata! production!!! deletion handling, thanks ash!!! purge, regen +tree-sitter docgen, purge, regen