Files
KioskConfig/.gitea/workflows/build-prod-kiosk.yml
T
NeilClack 1ec9fd81e5
build-prod-commercial.yml / build-commercial (push) Canceled after 0s
build-prod-android.yml / build-android (push) Successful in 3m44s
build-prod-kiosk.yml / build-kiosk (push) Successful in 3m39s
Pin moved 1.8 tag and guard the baked baseline against the published channel
The radiantwave 1.8 tag was force-moved from 34c72b5 to a5a6b5b while
flake.lock still pinned the old commit, so the ISO baked a baseline that
was not the closure RadiantWave CI published to Attic. With version 1.8
overridden this could still compile RadiantWave from source instead of
substituting it.

- Update flake.lock so radiantwave?ref=refs/tags/1.8 resolves to a5a6b5b.
- Expose channelVersion/channelAtticUrl/channelManifestDir/baselineOutPaths
  from flake.nix for CI verification.
- Prod workflows: fail fast unless channel.appVersion equals the channel
  manifest version, baselineOutPaths.<system> equals the manifest storePath,
  and that store path exists in the channel's Attic cache.
2026-10-04 15:50:48 -05:00

95 lines
4.0 KiB
YAML

on:
workflow_dispatch:
push:
branches:
- main
env:
NIX_CONFIG: |
extra-substituters = https://attic.radiantwavetech.com/radiantwave
extra-trusted-public-keys = radiantwave:QADrjpBWJssTZ3KmiZtcWEf4uAm66oOlHmtQI3jkrgA=
jobs:
build-kiosk:
runs-on: orion-lxc
steps:
- name: Checkout
run: git clone --depth 1 ssh://git@gitea.radiantwavetech.com:2222/RadiantWaveTech/KioskConfig.git .
- name: Guard main branch is on the production channel
run: |
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
NAME=$(nix eval --impure --raw .#channelName)
if [ "$NAME" != "radiantwave" ]; then
echo "ERROR: main branch resolves to the '$NAME' channel, expected 'radiantwave'."
echo " A dev->main merge brought a dev-pointing channel block into flake.nix."
echo " Set channel.appInput/atticRepo/gitRef back to main values before building prod ISOs."
exit 1
fi
# Fail fast unless the closure baked into the ISO is exactly what
# RadiantWave CI published to Attic. Otherwise the kiosk compiles
# RadiantWave from source (slow) and the live updater immediately swaps
# to the announced closure on first boot. See `channel` in flake.nix.
- name: Verify baked baseline matches the published channel
run: |
set -euo pipefail
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
VERSION=$(nix eval --impure --raw .#channelVersion)
ATTIC=$(nix eval --impure --raw .#channelAtticUrl)
MANIFEST_URL="$(nix eval --impure --raw .#channelManifestDir)/manifest.json"
BASELINE=$(nix eval --impure --raw .#baselineOutPaths.x86_64-linux)
MANIFEST=$(curl -fsSL "$MANIFEST_URL")
PUB_VERSION=$(MANIFEST="$MANIFEST" nix eval --impure --raw --expr '(builtins.fromJSON (builtins.getEnv "MANIFEST")).version')
PUB_PATH=$(MANIFEST="$MANIFEST" nix eval --impure --raw --expr '(builtins.fromJSON (builtins.getEnv "MANIFEST")).storePath')
echo "channel version : $VERSION"
echo "manifest version: $PUB_VERSION"
echo "baseline path : $BASELINE"
echo "manifest path : $PUB_PATH"
if [ "$VERSION" != "$PUB_VERSION" ]; then
echo "ERROR: channel.appVersion '$VERSION' != published manifest version '$PUB_VERSION'."
echo " Bump channel.appVersion (and the pinned radiantwave input) to match the release."
exit 1
fi
if [ "$BASELINE" != "$PUB_PATH" ]; then
echo "ERROR: baseline '$BASELINE' is not the published closure '$PUB_PATH'."
echo " Run 'nix flake update radiantwave' so the pinned input resolves to the release the manifest was built from."
exit 1
fi
HASH=$(basename "$BASELINE" | cut -d- -f1)
if ! curl -fsS -o /dev/null "$ATTIC/${HASH}.narinfo"; then
echo "ERROR: $BASELINE is not in $ATTIC; the ISO would compile RadiantWave from source."
exit 1
fi
- name: Prepare output directory
run: mkdir -p /var/lib/gitea-runner/radiantwave
- name: Build kiosk ISO
run: |
export NIXPKGS_ALLOW_UNFREE=1
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
nix build -L --impure .#nixosConfigurations.kiosk-iso.config.system.build.isoImage
- name: Rename kiosk ISO
run: |
ISO_DATE=$(date +%Y-%m-%d_%H-%M-%S)
FILENAME="radiantwave-home-${ISO_DATE}.iso"
cp -L result/iso/*.iso "/var/lib/gitea-runner/radiantwave/${FILENAME}"
echo "KIOSK_ISO_FILENAME=${FILENAME}" >> "$GITHUB_ENV"
- name: Copy kiosk ISO to fileserver
run: |
scp "/var/lib/gitea-runner/radiantwave/${KIOSK_ISO_FILENAME}" \
157.245.124.103:/mnt/infrastructure_data/files/images/
- name: Cleanup kiosk ISO
run: rm -f "/var/lib/gitea-runner/radiantwave/${KIOSK_ISO_FILENAME}"