mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-22 01:13:00 +02:00
Build the mkdocs User's Guide into WebUI images and surface it in the UI. post-build.sh runs `mkdocs build` from the top-level mkdocs.yml into /var/www/guide when the webui package is selected and mkdocs is on the build host; nginx serves it read-only at /guide/. The build is best-effort — a missing mkdocs warns and ships without the guide rather than failing — and minimal images (no webui) skip it. The WebUI gates a book icon in the topbar and a User Guide item in the user menu on the docs being present on disk (os.Stat, fail-closed), both opening /guide/ in a new tab. CI: a local setup-mkdocs composite action installs mkdocs and the plugins from mkdocs.yml; the build and release workflows run it before the build so images produced in CI include the guide. developers-guide documents the new build dependency and restores the missing mkdocs-glightbox plugin. Fixes #633 Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
101 lines
2.8 KiB
YAML
101 lines
2.8 KiB
YAML
# Needed for make pkg-stats
|
|
# sudo apt install python3-aiohttp
|
|
---
|
|
name: Build Release
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
version:
|
|
required: true
|
|
type: string
|
|
use_cache:
|
|
required: false
|
|
type: boolean
|
|
default: true
|
|
|
|
jobs:
|
|
build:
|
|
name: Build Infix ${{ inputs.version }} [${{ matrix.target }}]
|
|
runs-on: [self-hosted, release]
|
|
strategy:
|
|
matrix:
|
|
target: [aarch64, arm, x86_64]
|
|
fail-fast: false
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
clean: true
|
|
submodules: recursive
|
|
|
|
- uses: kernelkit/actions/podman-cleanup@v1
|
|
|
|
- name: Set Release Variables
|
|
id: vars
|
|
run: |
|
|
ver=${{ inputs.version }}
|
|
echo "ver=${ver}" >> $GITHUB_OUTPUT
|
|
fver=${ver#v}
|
|
target=${{ matrix.target }}-${fver}
|
|
echo "dir=infix-$target" >> $GITHUB_OUTPUT
|
|
echo "tgz=infix-$target.tar.gz" >> $GITHUB_OUTPUT
|
|
|
|
- uses: kernelkit/actions/cache-restore@v1
|
|
with:
|
|
target: ${{ matrix.target }}
|
|
enabled: ${{ inputs.use_cache }}
|
|
|
|
# WebUI images bundle the mkdocs User's Guide via post-build.sh.
|
|
- uses: ./.github/actions/setup-mkdocs
|
|
|
|
- name: Configure & Build
|
|
env:
|
|
INFIX_RELEASE: ${{ steps.vars.outputs.ver }}
|
|
run: |
|
|
target=${{ matrix.target }}_defconfig
|
|
echo "Building $target ..."
|
|
make $target
|
|
make
|
|
|
|
- name: Generate SBOM from Build
|
|
run: |
|
|
# Generate manifest files in CSV format for CycloneDX
|
|
make legal-info
|
|
# Generate cpe.json for CycloneDX
|
|
make -s show-info > output/cpe.json
|
|
# Generate pkg-stats.{json,html} for humans
|
|
make pkg-stats
|
|
|
|
- name: Build test specification
|
|
run: |
|
|
make test-spec
|
|
|
|
- name: Prepare Artifacts
|
|
run: |
|
|
cd output/
|
|
|
|
# Collect relevant files for SBOM and CPE info. for more info, see:
|
|
# https://github.com/CycloneDX/cyclonedx-buildroot
|
|
mkdir images/sbom
|
|
mv pkg-stats.* images/sbom/
|
|
mv cpe.json images/sbom/
|
|
mv legal-info/*.csv images/sbom/
|
|
|
|
# Remove rootfs.squashfs from release (can be extracted from rootfs.itb)
|
|
# Saves ~131MB per architecture. See issue #858
|
|
rm -f images/rootfs.squashfs
|
|
|
|
mv images ${{ steps.vars.outputs.dir }}
|
|
ln -s ${{ steps.vars.outputs.dir }} images
|
|
tar cfz ${{ steps.vars.outputs.tgz }} ${{ steps.vars.outputs.dir }}
|
|
|
|
- uses: actions/upload-artifact@v7
|
|
with:
|
|
name: artifact-${{ matrix.target }}
|
|
path: output/*.tar.gz
|
|
|
|
- uses: actions/upload-artifact@v7
|
|
with:
|
|
name: artifact-disk-image-${{ matrix.target }}
|
|
path: output/images/*.qcow2
|