-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (75 loc) · 3.04 KB
/
Copy pathaggregate.yml
File metadata and controls
87 lines (75 loc) · 3.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
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