From 7182b18c35a9f11ec44697a6f20b980d6f03a1e3 Mon Sep 17 00:00:00 2001 From: Safi Date: Wed, 10 Jun 2026 21:07:38 +0100 Subject: [PATCH] ci: add release-graph workflow to ship self-graph as release asset Runs graphify against its own source on every GitHub release (AST-only, no API cost) and attaches graph.json + graph.html + GRAPH_REPORT.md as graphify-self-graph.tar.gz to the release. Also supports manual runs via workflow_dispatch, uploading the bundle as a 7-day workflow artifact. Closes #1238 Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/release-graph.yml | 53 +++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/release-graph.yml diff --git a/.github/workflows/release-graph.yml b/.github/workflows/release-graph.yml new file mode 100644 index 0000000..ba2af86 --- /dev/null +++ b/.github/workflows/release-graph.yml @@ -0,0 +1,53 @@ +name: Release graph asset + +on: + release: + types: [published] + workflow_dispatch: + +jobs: + build-graph: + runs-on: ubuntu-latest + permissions: + contents: write # needed to upload release assets + + steps: + - uses: actions/checkout@v6 + + - name: Install uv + uses: astral-sh/setup-uv@v8.1.0 + with: + python-version: "3.12" + + - name: Install graphify + run: uv sync --frozen + + - name: Build graph of graphify source (AST-only, no API cost) + run: uv run --frozen graphify extract . --code-only --out graphify-out + + - name: Generate HTML viewer + run: uv run --frozen graphify export html --graph graphify-out/graph.json --out graphify-out/graph.html + + - name: Bundle release asset + run: | + mkdir -p dist-graph + cp graphify-out/graph.json dist-graph/ + cp graphify-out/graph.html dist-graph/ + cp graphify-out/GRAPH_REPORT.md dist-graph/ + tar -czf graphify-self-graph.tar.gz -C dist-graph . + echo "Asset contents:" + tar -tzf graphify-self-graph.tar.gz + + - name: Upload to GitHub release + if: github.event_name == 'release' + uses: softprops/action-gh-release@v2 + with: + files: graphify-self-graph.tar.gz + + - name: Upload as workflow artifact (for workflow_dispatch runs) + if: github.event_name == 'workflow_dispatch' + uses: actions/upload-artifact@v4 + with: + name: graphify-self-graph + path: graphify-self-graph.tar.gz + retention-days: 7