Files
Joachim Wiberg 461c092346 .github: publish .pkg bundle and Raspberry Pi image on release
Releases exposed the RAUC upgrade bundle only inside the per-arch
tarball, and shipped no ready-to-flash Raspberry Pi image; users had
to unpack the tarball or assemble an image from a separate bootloader.

Upload output/images/*.pkg as its own artifact, and build an rpi64 SD
card image in the aarch64 release leg before rootfs.squashfs is
stripped from the tarball, combining it with the rpi64 bootloader from
the latest-boot release.  Publish both as release assets; the tarball
still carries the .pkg too.

Closes #1084

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2026-07-06 05:28:10 +02:00

125 lines
3.7 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: kernelkit/actions/setup-mkdocs@v1.2
- name: Configure & Build
env:
INFIX_RELEASE: ${{ steps.vars.outputs.ver }}
run: |
target=${{ matrix.target }}_defconfig
echo "Building $target ..."
make $target apply-mirror
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
# rootfs.squashfs is still present here; it is stripped from the
# tarball below. mkimage pulls the rpi64 bootloader from the
# latest-boot release and uses the freshly built host genimage.
- name: Build Raspberry Pi image
if: matrix.target == 'aarch64'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./utils/mkimage.sh -d -r output raspberrypi-rpi64
mkdir -p rpi-image
mv output/images/*-rpi64-sdcard.img rpi-image/
xz -T0 rpi-image/*-rpi64-sdcard.img
- uses: actions/upload-artifact@v7
if: matrix.target == 'aarch64'
with:
name: artifact-rpi64-image
path: rpi-image/*.img.xz
- 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
- uses: actions/upload-artifact@v7
with:
name: artifact-pkg-${{ matrix.target }}
path: output/images/*.pkg