Aggregate registry #295
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Aggregate registry | |
| # Ingests the author manifests into registry.db (the durable source of truth — a failed author | |
| # fetch keeps that plugin's last-known-good rows) and exports the static catalog the Fizzy app | |
| # fetches (plugins/catalog/summary.json + one plugins/catalog/<abi_fingerprint>/releases.json | |
| # shard per SDK generation), then publishes plugins/ to GitHub Pages. See store/ for the tool. | |
| # Triggers: a registry/store change (reviewed PR merge), a periodic refresh so author manifest | |
| # updates land without a commit here, and manual runs. The path filter excludes plugins/** and | |
| # registry.db so the commit-back below never re-triggers the workflow. | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "registry/**" | |
| - "store/**" | |
| - ".github/workflows/aggregate.yml" | |
| schedule: | |
| - cron: "17 */6 * * *" # every 6 hours | |
| workflow_dispatch: | |
| # Allow committing the regenerated db + catalog and deploying Pages. | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| env: | |
| # Pinned so the workaround below targets a known path. Works around a Zig 0.16.0 bug where | |
| # `zig fetch` fails on zip dependencies (e.g. zig-sqlite's sqlite-amalgamation-*.zip) with | |
| # "failed to create temporary zip file: FileNotFound" when the global cache's tmp/ dir | |
| # doesn't exist yet (fresh runner). See https://codeberg.org/ziglang/zig/issues/35264. | |
| ZIG_GLOBAL_CACHE_DIR: ${{ github.workspace }}/.zig-global-cache | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: mlugg/setup-zig@v2 | |
| with: | |
| version: "0.16.0" | |
| - name: Work around zig fetch zip bug (codeberg.org/ziglang/zig#35264) | |
| run: mkdir -p "$ZIG_GLOBAL_CACHE_DIR/tmp" | |
| - name: Build the store tool | |
| working-directory: store | |
| run: zig build -Doptimize=ReleaseSafe | |
| - name: Ingest author manifests into registry.db | |
| working-directory: store | |
| run: ./zig-out/bin/store ingest --root .. --db ../registry.db | |
| - name: Export the catalog (summary + per-fingerprint shards) | |
| working-directory: store | |
| run: ./zig-out/bin/store export --db ../registry.db --out ../plugins/catalog | |
| - name: Commit registry.db + catalog if changed | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add registry.db plugins/catalog | |
| if ! git diff --quiet --cached; then | |
| git commit -m "chore: refresh registry.db + plugins/catalog" | |
| git push | |
| else | |
| echo "registry.db and catalog unchanged" | |
| fi | |
| - name: Upload Pages artifact (the plugins/ directory) | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: plugins | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - id: deployment | |
| uses: actions/deploy-pages@v4 |