The dev->main merge left the channel block in flake.nix pointing at radiantwave-dev, so prod ISOs built from main shipped the dev app (which versions itself by short git hash) and the updater polled the dev Attic manifest. Restore the channel block to main values, re-pin flake.lock to the latest radiantwave main revision, and expose channelName so the prod build workflows can fail fast if main ever resolves to the dev channel.
51 lines
2.0 KiB
YAML
51 lines
2.0 KiB
YAML
on:
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
NIX_CONFIG: |
|
|
extra-substituters = https://attic.radiantwavetech.com/radiantwave https://nixos-raspberrypi.cachix.org
|
|
extra-trusted-public-keys = radiantwave:QADrjpBWJssTZ3KmiZtcWEf4uAm66oOlHmtQI3jkrgA= nixos-raspberrypi.cachix.org-1:4iMO9LXa8BqhU+Rpg6LQKiGa2lsNh/j2oiYLNOQ5sPI=
|
|
|
|
jobs:
|
|
build-rpi:
|
|
runs-on: build-server
|
|
|
|
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 images."
|
|
exit 1
|
|
fi
|
|
|
|
- name: Prepare output directory
|
|
run: mkdir -p /home/user/radiantwave
|
|
|
|
- name: Build Raspberry Pi image
|
|
run: |
|
|
export NIXPKGS_ALLOW_UNFREE=1
|
|
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
|
nix build -L --impure .#nixosConfigurations.radiantwavekiosk-rpi.config.system.build.sdImage
|
|
|
|
- name: Rename Raspberry Pi image
|
|
run: |
|
|
ISO_DATE=$(date +%Y-%m-%d_%H-%M-%S)
|
|
FILENAME="radiantwave-rpi-${ISO_DATE}.img.zst"
|
|
cp -L result/sd-image/*.img.zst "/home/user/radiantwave/${FILENAME}"
|
|
echo "RPI_IMAGE_FILENAME=${FILENAME}" >> "$GITHUB_ENV"
|
|
|
|
- name: Copy Raspberry Pi image to fileserver
|
|
run: |
|
|
scp "/home/user/radiantwave/${RPI_IMAGE_FILENAME}" \
|
|
radiantwave-infra:/mnt/infrastructure_data/files/images/
|
|
|
|
- name: Cleanup Raspberry Pi image
|
|
run: rm -f "/home/user/radiantwave/${RPI_IMAGE_FILENAME}"
|