From 63b380c86fa373727db2068c3977caa77edf1f9f Mon Sep 17 00:00:00 2001 From: Gerwin Klein Date: Tue, 3 Nov 2026 11:27:52 +1100 Subject: [PATCH 1/2] platforms.json: use filters for json template Use Liquid filters instead for the json template so that we don't get any trailing commas by accident. The previous forloop.last check was insufficient, because there could be another element in the loop that will then not be printed, because it is not maintained. Signed-off-by: Gerwin Klein --- Hardware/platforms.json | 34 +++++----------------------------- 1 file changed, 5 insertions(+), 29 deletions(-) diff --git a/Hardware/platforms.json b/Hardware/platforms.json index 949804bf5a6..5121c5c13c5 100644 --- a/Hardware/platforms.json +++ b/Hardware/platforms.json @@ -3,34 +3,10 @@ layout: null SPDX-License-Identifier: CC-BY-SA-4.0 SPDX-FileCopyrightText: 2025 seL4 International --- - +{%- assign arm = site.pages | where_exp: "p", "p.arm_hardware and p.Maintained" | sort: "platform" | map: "platform" %} +{%- assign riscv = site.pages | where_exp: "p", "p.riscv_hardware and p.Maintained" | sort: "platform" | map: "platform" %} [ - [ - "Arm", - [ -{%- assign sorted = site.pages | sort: 'platform' %} -{%- for page in sorted %} -{%- if page.arm_hardware and page.Maintained %} - "{{ page.platform }}"{% unless forloop.last %},{% endunless %} -{%- endif %} -{%- endfor %} - ] - ], - [ - "RISC-V", - [ -{%- assign sorted = site.pages | sort: 'platform' %} -{%- for page in sorted %} -{%- if page.riscv_hardware and page.Maintained %} - "{{ page.platform }}"{% unless forloop.last %},{% endunless %} -{%- endif %} -{%- endfor %} - ] - ], - [ - "Intel", - [ - "32 and 64 bit PC-99 machines" - ] - ] + ["Arm", {{ arm | jsonify }}], + ["RISC-V", {{ riscv | jsonify }}], + ["Intel", ["32 and 64 bit PC-99 machines"]] ] From e8797b246b79d90a1f5cb5cf6d0e96e728a69367 Mon Sep 17 00:00:00 2001 From: Gerwin Klein Date: Tue, 3 Nov 2026 11:37:26 +1100 Subject: [PATCH 2/2] github: auto-deploy new platforms.json Deploy any changes in the generated platforms.json automatically to the main seL4 website repo. Do nothing if platforms have not changed. A successful push will trigger a corresponding rebuild and deploy on the website repo. Signed-off-by: Gerwin Klein --- .github/workflows/build.yml | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5d464414c6b..826ee22620d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -68,3 +68,43 @@ jobs: - run: git config user.email ci@sel4.systems - run: git commit -m "auto-deployed" - run: git push + + # Push platforms.json to the website repo if changed + platforms-push: + if: ${{ github.repository_owner == 'seL4' && + (github.event_name == 'push' || github.event_name == 'schedule' || + github.event_name == 'workflow_dispatch') }} + needs: build + name: 'Update platforms.json on website' + runs-on: ubuntu-24.04 + steps: + # fetch only _data/ and top-level files, not the full repo and no large files + - name: Check out website repo + uses: actions/checkout@v6 + with: + repository: seL4/website + path: website + token: ${{ secrets.PRIV_REPO_TOKEN }} + fetch-depth: 1 + filter: blob:none + sparse-checkout: _data + - uses: actions/download-artifact@v8 + with: + name: site + - name: Unpack site + run: tar -xvf site.tar _site/Hardware/platforms.json + - name: Validate json + run: jq empty _site/Hardware/platforms.json + - name: Push to website + run: | + cp _site/Hardware/platforms.json website/_data/platforms.json + cd website + git add _data/platforms.json + if git diff --cached --quiet; then + echo "platforms.json unchanged" + exit 0 + fi + git config user.name "seL4 CI" + git config user.email "ci@sel4.systems" + git commit -s -m "CI: update platforms from docsite" + git push origin HEAD:master