Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
156 commits
Select commit Hold shift + click to select a range
3b0a9a2
feat: add CI/CD workflows for NixOS build and release
mrosseel Feb 4, 2026
f2c88e6
fix: add filesystem stub for CI closure builds
mrosseel Feb 4, 2026
0257842
fix: add pifinder.devMode option declaration
mrosseel Feb 4, 2026
a1ba877
fix: wrap services.nix config in explicit config block
mrosseel Feb 4, 2026
454726f
fix: add package hashes to python-env.nix
mrosseel Feb 4, 2026
10d0c33
feat: support self-hosted ARM64 runner for faster builds
mrosseel Feb 4, 2026
5b17091
fix: add device tree filter and fix PWM overlay syntax
mrosseel Feb 4, 2026
7292ac6
fix: add write permissions and self-hosted runner to release workflow
mrosseel Feb 5, 2026
9fcc29e
fix: use ubuntu-latest for all workflows, simplify QEMU setup
mrosseel Feb 5, 2026
7430061
fix: lint and type errors in sys_utils_nixos.py
mrosseel Feb 5, 2026
6000482
fix: swap noqa/type-ignore comment order for ruff
mrosseel Feb 5, 2026
001751d
fix: name SD image with version tag
mrosseel Feb 5, 2026
9c361a6
fix: add sys_utils_base.py to tracked files
mrosseel Feb 5, 2026
a2c0f9a
fix: NixOS netboot camera, sys_utils, and solver issues
mrosseel Feb 6, 2026
34dca88
feat: runtime camera selection via /boot/camera.txt for SD cards
mrosseel Feb 6, 2026
d12ca7a
feat(nixos): refactor sys_utils and add netboot deploy script
mrosseel Feb 7, 2026
2aa6e15
fix: misc UI, DB, and CI improvements
mrosseel Feb 7, 2026
d606d40
fix(netboot): improve NFS compatibility for Nix store
mrosseel Feb 9, 2026
63e727d
fix(deploy): add SSH keepalives and improve rsync transfer
mrosseel Feb 9, 2026
a919541
fix: move comet_file to writable data_dir
mrosseel Feb 9, 2026
dcb241a
fix(netboot): improve initrd network and add libcamera IPA path
mrosseel Feb 9, 2026
ddd3f97
fix: add missing PWM udev rule
mrosseel Feb 9, 2026
329d7c2
feat: add early boot LED indicator service
mrosseel Feb 9, 2026
04576e1
feat: add C boot splash with Knight Rider animation
mrosseel Feb 9, 2026
b3bd709
fix: make Knight Rider scanner brighter red
mrosseel Feb 9, 2026
91f926e
fix: stop boot-splash via ExecStartPre instead of conflicts
mrosseel Feb 9, 2026
9a70253
fix: minimize bootstrap closure size
mrosseel Feb 9, 2026
e78c47e
fix: strip more bloat from bootstrap
mrosseel Feb 9, 2026
371655a
fix: disable NetworkManager VPN plugins
mrosseel Feb 9, 2026
530717c
fix: swap type-ignore before noqa for mypy parsing
mrosseel Feb 9, 2026
75fdff8
fix: strip more bloat - disable xdg, fuse, perl deps
mrosseel Feb 9, 2026
0c4ef2e
fix: disable lesspipe (pulls perl 112MB)
mrosseel Feb 9, 2026
617d202
fix: replace NetworkManager with wpa_supplicant
mrosseel Feb 9, 2026
baf9d1b
fix: override NetworkManager to exclude openconnect
mrosseel Feb 9, 2026
c5eefd6
fix: remove invalid NetworkManager overlay
mrosseel Feb 9, 2026
b2c18c5
fix: use bare type: ignore for gi.repository import
mrosseel Feb 9, 2026
448e256
fix: override openconnect with dummy to remove GTK dep
mrosseel Feb 9, 2026
7c82e9a
fix: override modemmanager to remove 284MB cellular bloat
mrosseel Feb 9, 2026
4f7f816
revert: remove broken modemmanager override
mrosseel Feb 9, 2026
64669d2
feat: switch from NetworkManager to iwd + systemd-networkd
mrosseel Feb 9, 2026
c3eb187
fix: disable more documentation modules
mrosseel Feb 9, 2026
14f13f5
fix: mkForce systemPackages to exclude w3m from base profile
mrosseel Feb 9, 2026
b3ef9a6
fix: disable containers to remove perl (112MB)
mrosseel Feb 9, 2026
957b55e
fix: PWM overlay pinctrl and boot splash improvements
mrosseel Feb 9, 2026
f00b041
ci: use Pi5 native runner with ubuntu-latest fallback
mrosseel Feb 9, 2026
78c1eb9
fix(ci): use correct flake output names
mrosseel Feb 9, 2026
721e59b
fix: use /etc/static for symlinks in deploy script
mrosseel Feb 9, 2026
258a367
fix: use Type=simple for pifinder service
mrosseel Feb 9, 2026
bf4d561
fix: remove pam.d before symlink in deploy script
mrosseel Feb 9, 2026
59a146f
fix: point bootstrap flake to mrosseel/PiFinder/nixos
mrosseel Feb 9, 2026
791d99a
feat: centralize PiFinder repo URL in pifinder.repoUrl option
mrosseel Feb 9, 2026
c971bd2
ci: add bootstrap tarball build workflow
mrosseel Feb 9, 2026
f236d32
ci: trigger bootstrap build on push to nixos branch
mrosseel Feb 9, 2026
3d43eb3
fix(ci): find image file not directory
mrosseel Feb 9, 2026
86a9273
fix(ci): use sudo for tar and exclude lost+found
mrosseel Feb 9, 2026
34e412b
fix(ci): clean up leftover files from previous runs
mrosseel Feb 9, 2026
5e0ed42
feat: manifest-based software update UI with channels
mrosseel Feb 10, 2026
21c23c2
chore: add nix dev shell for local testing
mrosseel Feb 10, 2026
7334f30
feat: camera switching via NixOS specialisations
mrosseel Feb 10, 2026
7204b16
fix: use absolute path for sudo in sys_utils
mrosseel Feb 10, 2026
e8c6f2e
fix: use absolute paths for systemctl/journalctl in sys_utils
mrosseel Feb 10, 2026
6b69b89
feat: upgrade nixpkgs 24.11 → 25.11 (Python 3.13)
mrosseel Feb 10, 2026
6a81855
fix: u-boot boot chain, RPi.GPIO aarch64, I2C, sudo, /boot mount
mrosseel Feb 11, 2026
2007bda
perf: boot time optimizations and u-boot PCI/USB stripping
mrosseel Feb 11, 2026
4e67699
fix: bootstrap migration progress and nix fetch issues
mrosseel Feb 11, 2026
be3a4cc
feat: unified nix dev shell, pygame keyboard, software update UI
mrosseel Feb 11, 2026
7b78f40
fix: camera test mode, PAM auth, service PATH, AP networking
mrosseel Feb 11, 2026
1ac9d9b
feat: include catalog images in SD card image
mrosseel Feb 12, 2026
6e80659
feat: bootstrap migration tarball and pifinder-src optimization
mrosseel Feb 12, 2026
f804d57
refactor: remove bootstrapMode, use full system for migration tarball
mrosseel Feb 12, 2026
fdb9300
fix: keep welcome.png in pifinder-src (needed at runtime)
mrosseel Feb 12, 2026
57cf44c
feat: add nix-path-registration first-boot service
mrosseel Feb 12, 2026
3cd23c7
feat: store-path-based NixOS upgrade
mrosseel Feb 13, 2026
a883cd7
chore: stamp build [skip ci]
github-actions[bot] Feb 13, 2026
72850d8
perf: optimize boot time with lazy imports and combined DB queries
mrosseel Feb 11, 2026
c28a8e2
chore: bump version to 2.5.1
mrosseel Feb 12, 2026
231b3ff
chore: stamp build [skip ci]
github-actions[bot] Feb 13, 2026
8055301
chore: stamp build [skip ci]
github-actions[bot] Feb 13, 2026
30194a0
fix: use nix build instead of nix copy --from in upgrade service
mrosseel Feb 13, 2026
c27ed16
chore: stamp build [skip ci]
github-actions[bot] Feb 13, 2026
5e642ce
style: apply ruff formatting to Python codebase
mrosseel Feb 13, 2026
5e75817
refactor: replace nox/pip with nix develop for CI and dev tooling
mrosseel Feb 13, 2026
676be12
fix: add watchdog fallback for CI when self-hosted runner unavailable
mrosseel Feb 13, 2026
204be3f
fix: add SSH port 22 to firewall allowedTCPPorts
mrosseel Feb 13, 2026
e817105
fix: open firewall for Samba, remove redundant SSH port
mrosseel Feb 13, 2026
c1d8e8c
chore: stamp build [skip ci]
github-actions[bot] Feb 13, 2026
bf0054a
chore: stamp build [skip ci]
github-actions[bot] Feb 13, 2026
c76fdcd
fix: clean stale avahi PID file before restart
mrosseel Feb 13, 2026
da85b86
chore: stamp build [skip ci]
github-actions[bot] Feb 13, 2026
8b60e3c
fix: disable Determinate Nix to avoid FlakeHub registration
mrosseel Feb 13, 2026
98cdafe
chore: stamp build [skip ci]
github-actions[bot] Feb 13, 2026
0359235
fix: harden avahi hostname handling and use display constants
mrosseel Feb 13, 2026
bb2b72e
fix: run switch-to-configuration in detached scope during upgrade
mrosseel Feb 13, 2026
1cffae1
chore: stamp build [skip ci]
github-actions[bot] Feb 13, 2026
ecf0c3d
fix: use restartIfChanged/stopIfChanged for upgrade service
mrosseel Feb 13, 2026
0fde64e
chore: stamp build [skip ci]
github-actions[bot] Feb 13, 2026
c8cb786
refactor: replace version.txt with pifinder-build.json
mrosseel Feb 13, 2026
13b566c
refactor: remove unused update_needed function and tests
mrosseel Feb 13, 2026
26e8049
ci: add concurrency group to prevent queued run pileup
mrosseel Feb 13, 2026
1c3979e
chore: stamp build [skip ci]
github-actions[bot] Feb 13, 2026
8daa0f9
ci: trigger rebuild [skip ci-lint]
mrosseel Feb 13, 2026
40688c4
fix: use nix build instead of nix copy for upgrades
mrosseel Feb 13, 2026
0c0a523
chore: stamp build [skip ci]
github-actions[bot] Feb 13, 2026
021667d
ci: add config key removal warning for PRs
mrosseel Feb 13, 2026
c183328
refactor: replace version.txt with pifinder-build.json
mrosseel Feb 13, 2026
c55bf84
refactor: remove unused update_needed function and tests
mrosseel Feb 13, 2026
3189497
ci: add concurrency group to prevent queued run pileup
mrosseel Feb 13, 2026
cba851a
feat: persist unstable channel unlock across restarts
mrosseel Feb 13, 2026
25e235d
feat: persist unstable channel unlock across restarts
mrosseel Feb 13, 2026
3bace42
chore: stamp build [skip ci]
github-actions[bot] Feb 13, 2026
f40a984
chore: stamp build [skip ci]
github-actions[bot] Feb 13, 2026
6a64841
feat: add upgrade progress UI with download tracking
mrosseel Feb 18, 2026
40d8bc8
chore: stamp build [skip ci]
github-actions[bot] Feb 18, 2026
922c1b6
fix: use loose rpfilter for multi-interface WiFi+ethernet support
mrosseel Feb 19, 2026
53f1046
fix: use loose rpfilter for multi-interface WiFi+ethernet support
mrosseel Feb 19, 2026
2d0ccdb
chore: stamp build [skip ci]
github-actions[bot] Feb 19, 2026
d213652
ci: use nix develop for lint/test workflow
mrosseel Feb 19, 2026
802fb23
fix: resolve lint errors for CI
mrosseel Feb 19, 2026
a0f29e9
chore: remove .direnv from tracking
mrosseel Feb 19, 2026
9c366c4
docs: add critical Pi 4 build limitations to CLAUDE.md
mrosseel Feb 19, 2026
49a2fc8
feat: add dev mode toggle and screen off burn-in protection
mrosseel Feb 19, 2026
d79c103
feat: add test mode toggle with visual feedback
mrosseel Feb 20, 2026
c1dc370
chore: stamp build [skip ci]
github-actions[bot] Feb 20, 2026
a6a8ef4
revert: remove test mode and dev mode features (moved to screensaver …
mrosseel Feb 20, 2026
2952da1
chore: stamp build [skip ci]
github-actions[bot] Feb 20, 2026
97c9ce2
feat: auto-generate pifinder-build.json from git rev at nix build time
mrosseel Feb 21, 2026
763062b
Merge branch 'nixos' into boot-speed
mrosseel Feb 21, 2026
4133bee
feat: auto-generate pifinder-build.json from git rev at nix build time
mrosseel Feb 21, 2026
fcbe630
chore: stamp build [skip ci]
github-actions[bot] Feb 21, 2026
1959bae
feat: replace bootstrap tarball with DD-able migration image
mrosseel Feb 23, 2026
123e4f6
chore: stamp build [skip ci]
github-actions[bot] Feb 23, 2026
463b21a
fix: revert to tarball approach for migration (SD image too large for…
mrosseel Feb 23, 2026
3e78e8e
chore: stamp build [skip ci]
github-actions[bot] Feb 23, 2026
3701785
fix: clean up stale mounts before migration tarball build
mrosseel Feb 24, 2026
99ba14c
chore: stamp build [skip ci]
github-actions[bot] Feb 24, 2026
e68c241
fix: clean up stale tarballs from previous workflow runs
mrosseel Feb 24, 2026
5d48cff
chore: stamp build [skip ci]
github-actions[bot] Feb 24, 2026
0a7e7b5
feat: auto-update migration branch SHA256 after tarball build
mrosseel Feb 24, 2026
24a57a1
chore: stamp build [skip ci]
github-actions[bot] Feb 24, 2026
370762f
feat: add minimal migration profile with first-boot deferred download
mrosseel Feb 24, 2026
b85f7f1
chore: stamp build [skip ci]
github-actions[bot] Feb 24, 2026
ed8faa7
feat: merge migration tarball build into main CI workflow
mrosseel Feb 24, 2026
7d2dbca
chore: stamp build [skip ci]
github-actions[bot] Feb 24, 2026
09d9465
fix: shrink migration closure by ~200MB
mrosseel Feb 24, 2026
c1444ca
chore: stamp build [skip ci]
github-actions[bot] Feb 24, 2026
e175730
fix: remove nixpkgs source, python, perl from migration closure
mrosseel Feb 24, 2026
d7a0cdf
chore: stamp build [skip ci]
github-actions[bot] Feb 24, 2026
df6143e
fix: log uncompressed size in migration tarball build
mrosseel Feb 24, 2026
7dbdc53
chore: stamp build [skip ci]
github-actions[bot] Feb 24, 2026
68ec945
feat: build migration tarball directly from nix store closure
mrosseel Feb 24, 2026
e4b639f
chore: stamp build [skip ci]
github-actions[bot] Feb 24, 2026
da65780
fix: use sudo for tarball staging cleanup
mrosseel Feb 24, 2026
8b187a7
chore: stamp build [skip ci]
github-actions[bot] Feb 24, 2026
5087f01
feat: merge upstream/main into nixos
mrosseel Mar 9, 2026
a229215
Merge branch 'nixos' of github.com:mrosseel/PiFinder into nixos
mrosseel Mar 9, 2026
940564d
merge: sync with latest nixos (upstream/main merge)
mrosseel Mar 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
150 changes: 150 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
name: Build PiFinder NixOS

on:
push:
branches: [main, nixos]
pull_request:
types: [labeled, synchronize, opened]
workflow_dispatch:

concurrency:
group: build-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true

jobs:
# Try Pi5 native build first (fast)
build-native:
if: |
github.event_name == 'push' ||
github.event_name == 'workflow_dispatch' ||
contains(github.event.pull_request.labels.*.name, 'preview') ||
contains(github.event.pull_request.labels.*.name, 'testable')
runs-on: [self-hosted, aarch64]
timeout-minutes: 30
outputs:
success: ${{ steps.build.outcome == 'success' }}
store_path: ${{ steps.push.outputs.store_path }}
steps:
- uses: actions/checkout@v4

- uses: cachix/cachix-action@v15
with:
name: pifinder
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'

- name: Build NixOS system closure
id: build
run: |
nix build .#nixosConfigurations.pifinder.config.system.build.toplevel \
-L --no-link

- name: Push to Cachix
id: push
run: |
STORE_PATH=$(nix build .#nixosConfigurations.pifinder.config.system.build.toplevel \
--json | jq -r '.[].outputs.out')
echo "$STORE_PATH" | cachix push pifinder
echo "store_path=$STORE_PATH" >> "$GITHUB_OUTPUT"

# Wait up to 15 min for native builder, then decide on fallback
native-wait:
if: |
github.event_name == 'push' ||
github.event_name == 'workflow_dispatch' ||
contains(github.event.pull_request.labels.*.name, 'preview') ||
contains(github.event.pull_request.labels.*.name, 'testable')
runs-on: ubuntu-latest
timeout-minutes: 20
outputs:
need_emulated: ${{ steps.wait.outputs.need_emulated }}
steps:
- name: Wait for native build
id: wait
env:
GH_TOKEN: ${{ github.token }}
run: |
for i in $(seq 1 30); do
sleep 30
RESULT=$(gh api "repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs" \
--jq '.jobs[] | select(.name == "build-native") | .conclusion // "pending"' 2>/dev/null || echo "pending")
echo "Check $i/30: build-native=$RESULT"
if [ "$RESULT" = "success" ]; then
echo "need_emulated=false" >> "$GITHUB_OUTPUT"
exit 0
elif [ "$RESULT" = "failure" ] || [ "$RESULT" = "cancelled" ]; then
echo "need_emulated=true" >> "$GITHUB_OUTPUT"
exit 0
fi
done
echo "Native build not done after 15 min, falling back to emulated"
echo "need_emulated=true" >> "$GITHUB_OUTPUT"

# Fallback to QEMU emulation if Pi5 unavailable or slow
build-emulated:
needs: native-wait
if: needs.native-wait.outputs.need_emulated == 'true'
runs-on: ubuntu-latest
timeout-minutes: 360
outputs:
store_path: ${{ steps.push.outputs.store_path }}
steps:
- uses: actions/checkout@v4

- uses: cachix/install-nix-action@v27
with:
extra_nix_config: |
extra-platforms = aarch64-linux
extra-system-features = big-parallel

- uses: cachix/cachix-action@v15
with:
name: pifinder
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'

- name: Register QEMU binfmt for aarch64
run: sudo apt-get update && sudo apt-get install -y qemu-user-static

- name: Build NixOS system closure
run: |
nix build .#nixosConfigurations.pifinder.config.system.build.toplevel \
--system aarch64-linux \
-L --no-link

- name: Push to Cachix
id: push
run: |
STORE_PATH=$(nix build .#nixosConfigurations.pifinder.config.system.build.toplevel \
--system aarch64-linux \
--json | jq -r '.[].outputs.out')
echo "$STORE_PATH" | cachix push pifinder
echo "store_path=$STORE_PATH" >> "$GITHUB_OUTPUT"

# Commit pifinder-build.json with store path to the same branch
stamp-build:
needs: [build-native, build-emulated]
if: always() && (needs.build-native.result == 'success' || needs.build-emulated.result == 'success')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref || github.ref_name }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Write pifinder-build.json
run: |
STORE_PATH="${{ needs.build-native.outputs.store_path || needs.build-emulated.outputs.store_path }}"
BRANCH="${{ github.head_ref || github.ref_name }}"
SHORT_SHA=$(git rev-parse --short HEAD)
VERSION="${BRANCH}-${SHORT_SHA}"
jq -n --arg sp "$STORE_PATH" --arg v "$VERSION" \
'{store_path: $sp, version: $v}' > pifinder-build.json

- name: Commit pifinder-build.json
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add pifinder-build.json
git diff --staged --quiet || git commit -m "chore: stamp build [skip ci]"
git push
56 changes: 56 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Lint & Test
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: DeterminateSystems/nix-installer-action@main
with:
determinate: false
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Lint
run: nix develop --command bash -c "cd python && ruff check"
- name: Format check
run: nix develop --command bash -c "cd python && ruff format --check"
- name: Check for removed config keys
if: github.event_name == 'pull_request'
run: |
BASE_SHA="${{ github.event.pull_request.base.sha }}"
git show "$BASE_SHA:default_config.json" 2>/dev/null \
| python3 -c "import json,sys; print('\n'.join(sorted(json.load(sys.stdin).keys())))" \
> /tmp/base_keys.txt || exit 0
python3 -c "import json,sys; print('\n'.join(sorted(json.load(sys.stdin).keys())))" \
< default_config.json > /tmp/head_keys.txt
REMOVED=$(comm -23 /tmp/base_keys.txt /tmp/head_keys.txt)
if [ -n "$REMOVED" ]; then
while IFS= read -r key; do
echo "::warning file=default_config.json::Config key '$key' was removed — this may break user preferences across release switches"
done <<< "$REMOVED"
fi

type-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
with:
determinate: false
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Type check
run: nix develop --command bash -c "cd python && mypy --install-types --non-interactive ."

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
with:
determinate: false
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Smoke tests
run: nix develop --command bash -c "cd python && pytest -m smoke"
- name: Unit tests
run: nix develop --command bash -c "cd python && pytest -m unit"
14 changes: 0 additions & 14 deletions .github/workflows/nox.yml

This file was deleted.

132 changes: 132 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
name: Release

on:
workflow_dispatch:
inputs:
version:
description: 'Version (e.g., 2.5.0)'
required: true
notes:
description: 'Release notes'
required: true
type:
description: 'Release type'
type: choice
options:
- stable
- beta
default: stable
source_branch:
description: 'Source branch (default: main, use release/X.Y for hotfixes)'
required: false
default: 'main'

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.source_branch }}
token: ${{ secrets.GITHUB_TOKEN }}

- uses: cachix/install-nix-action@v27
with:
extra_nix_config: |
extra-platforms = aarch64-linux
extra-system-features = big-parallel

- uses: cachix/cachix-action@v15
with:
name: pifinder
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'

- name: Register QEMU binfmt for aarch64
run: sudo apt-get update && sudo apt-get install -y qemu-user-static

- name: Build and push closure to Cachix
id: push
run: |
STORE_PATH=$(nix build .#nixosConfigurations.pifinder.config.system.build.toplevel \
--system aarch64-linux -L --json | jq -r '.[].outputs.out')
echo "$STORE_PATH" | cachix push pifinder
echo "store_path=$STORE_PATH" >> "$GITHUB_OUTPUT"

- name: Stamp pifinder-build.json and create tag
run: |
TAG="v${{ inputs.version }}"
[[ "${{ inputs.type }}" == "beta" ]] && TAG="${TAG}-beta"

STORE_PATH="${{ steps.push.outputs.store_path }}"
VERSION="${{ inputs.version }}"
jq -n --arg sp "$STORE_PATH" --arg v "$VERSION" \
'{store_path: $sp, version: $v}' > pifinder-build.json

git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add pifinder-build.json
git diff --staged --quiet || git commit -m "release: stamp build for $TAG [skip ci]"
git push origin "${{ inputs.source_branch }}"

git tag "$TAG"
git push origin "$TAG"
echo "TAG=$TAG" >> $GITHUB_ENV

- name: Build SD image
run: |
nix build .#images.pifinder \
--system aarch64-linux \
-L -o result-sd
mkdir -p release
for f in result-sd/sd-image/*.img.zst; do
cp "$f" "release/pifinder-${TAG}.img.zst"
done

- name: Build migration tarball from SD image
run: |
IMAGE_FILE=$(find result-sd/sd-image -type f \( -name "*.img" -o -name "*.img.zst" \) | head -1)

rm -f /tmp/pifinder-release.img
if [[ "${IMAGE_FILE}" == *.zst ]]; then
zstd -d "${IMAGE_FILE}" -o /tmp/pifinder-release.img
else
cp "${IMAGE_FILE}" /tmp/pifinder-release.img
fi

LOOP=$(sudo losetup --find --show --partscan /tmp/pifinder-release.img)
sudo mkdir -p /mnt/boot /mnt/root
sudo mount "${LOOP}p1" /mnt/boot
sudo mount "${LOOP}p2" /mnt/root

mkdir -p /tmp/tarball-staging
sudo cp -a /mnt/boot /tmp/tarball-staging/boot
sudo cp -a /mnt/root /tmp/tarball-staging/rootfs
sudo rm -rf /tmp/tarball-staging/rootfs/home/pifinder/PiFinder_data/catalog_images

sudo umount /mnt/boot /mnt/root
sudo losetup -d "${LOOP}"
rm -f /tmp/pifinder-release.img

sudo tar -C /tmp/tarball-staging -cf - \
--exclude='*/lost+found' \
boot rootfs | zstd -T0 -19 -o "release/pifinder-migration-${TAG}.tar.zst"
sudo rm -rf /tmp/tarball-staging

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: pifinder-release-${{ env.TAG }}
path: release/pifinder-*.zst
retention-days: 90

- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.TAG }}
name: PiFinder ${{ env.TAG }}
body: ${{ inputs.notes }}
prerelease: ${{ inputs.type == 'beta' }}
files: |
release/pifinder-*.zst
38 changes: 25 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/saltstack/mirrors-nox
rev: 'v2022.11.21' # Use the sha / tag you want to point at
- repo: local
hooks:
- id: nox
files: ^.*\.py$
args:
- -f
- python/noxfile.py
- -s
- type_hints
- smoke_tests
- --
- id: ruff-lint
name: ruff lint
entry: bash -c 'cd python && ruff check'
language: system
files: ^python/.*\.py$
pass_filenames: false
- id: ruff-format
name: ruff format check
entry: bash -c 'cd python && ruff format --check'
language: system
files: ^python/.*\.py$
pass_filenames: false
- id: mypy
name: mypy type check
entry: bash -c 'cd python && mypy .'
language: system
files: ^python/.*\.py$
pass_filenames: false
- id: smoke-tests
name: smoke tests
entry: bash -c 'cd python && pytest -m smoke'
language: system
files: ^python/.*\.py$
pass_filenames: false
Loading
Loading