Build optimization: pre-built PM3 binaries, ARM64 CI, base image caching

Replace PM3 compile-from-source in pi-gen with pre-built tarball extraction
(saves 43-58 min). Merge stagePM3 into stageDangerousPi as 02-pm3-install
substage, renumber all subsequent substages. Switch CI PM3 build to native
ARM64 runner (ubuntu-24.04-arm64) eliminating QEMU overhead. Add weekly
base-image workflow for pre-baking stages 0-2. Support PM3_TARBALL,
BASE_IMAGE, and APT_PROXY env vars in build-image.sh.

Also includes prior Phase 5 work: theme system, design system integration,
component update system, OS updates, CI build pipeline, and test results.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
michael
2026-03-04 12:01:01 -08:00
parent 2ec89041ef
commit a9acdb85ce
163 changed files with 8124 additions and 921 deletions

77
.github/workflows/base-image.yml vendored Normal file
View File

@@ -0,0 +1,77 @@
name: Build Base Image (Stages 0-2)
on:
schedule:
# Weekly on Sunday at 04:00 UTC
- cron: '0 4 * * 0'
workflow_dispatch:
permissions:
contents: write
jobs:
build-base:
runs-on: ubuntu-24.04-arm64
timeout-minutes: 120
steps:
- uses: actions/checkout@v4
- name: Set up pi-gen
run: |
git clone --depth 1 https://github.com/RPi-Distro/pi-gen.git /tmp/pi-gen-builder
- name: Configure base-only build
run: |
cd /tmp/pi-gen-builder
# Copy our config but override STAGE_LIST to only build base stages
cp "${GITHUB_WORKSPACE}/pi-gen/config" config
sed -i 's/^STAGE_LIST=.*/STAGE_LIST="stage0 stage1 stage2"/' config
# Mark stage2 for export so we get the rootfs
touch stage2/EXPORT_IMAGE
- name: Build base image
run: |
cd /tmp/pi-gen-builder
PIGEN_DOCKER_MODE=1 ./build-docker.sh
- name: Package base rootfs
run: |
cd /tmp/pi-gen-builder
DATE="$(date -u +%Y%m%d)"
# Find the stage2 rootfs in the work directory
ROOTFS_DIR=$(find work/ -path "*/stage2/rootfs" -type d | head -1)
if [ -z "$ROOTFS_DIR" ]; then
echo "ERROR: stage2 rootfs not found"
exit 1
fi
echo "Packaging rootfs from: $ROOTFS_DIR"
tar -czf "${GITHUB_WORKSPACE}/base-image-trixie-arm64-${DATE}.tar.gz" \
-C "$(dirname "$ROOTFS_DIR")" rootfs/
ls -lh "${GITHUB_WORKSPACE}/base-image-trixie-arm64-${DATE}.tar.gz"
- name: Create base image release
env:
GH_TOKEN: ${{ github.token }}
run: |
DATE="$(date -u +%Y%m%d)"
TAG="base-v${DATE}"
TARBALL="base-image-trixie-arm64-${DATE}.tar.gz"
# Delete previous base release if exists (keep only latest)
gh release delete "$TAG" --yes 2>/dev/null || true
git push --delete origin "$TAG" 2>/dev/null || true
# Create new release
gh release create "$TAG" "$TARBALL" \
--title "Base Image ${DATE}" \
--notes "Pre-baked base image (stages 0-2) for Debian Trixie arm64.
Use with: BASE_IMAGE=./${TARBALL} ./build-image.sh full
Built: $(date -u +%Y-%m-%d\ %H:%M:%S\ UTC)" \
--prerelease

152
.github/workflows/build-release.yml vendored Normal file
View File

@@ -0,0 +1,152 @@
name: Build and Release Components
on:
push:
tags: ['v*']
workflow_dispatch:
inputs:
components:
description: 'Components to build (comma-separated, or "all")'
required: false
default: 'all'
permissions:
contents: write
jobs:
# ------------------------------------------------------------------
# PM3: compile natively on ARM64 runner (no QEMU overhead)
# ------------------------------------------------------------------
build-pm3:
runs-on: ubuntu-24.04-arm64
strategy:
matrix:
python_version: ['3.11', '3.12']
steps:
- uses: actions/checkout@v4
- name: Build PM3 natively on aarch64
env:
PYTHON_VERSION: ${{ matrix.python_version }}
run: |
docker run --rm \
-v "${GITHUB_WORKSPACE}:/workspace" \
-e "PYTHON_VERSION=${PYTHON_VERSION}" \
-e OUTPUT_DIR=/workspace/dist \
-w /workspace \
debian:trixie \
bash ci/build-pm3.sh
- uses: actions/upload-artifact@v4
with:
name: pm3-cp${{ matrix.python_version }}
path: dist/pm3-*.tar.gz
# ------------------------------------------------------------------
# Frontend: build Remix app
# ------------------------------------------------------------------
build-frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
- name: Build frontend
env:
REF_NAME: ${{ github.ref_name }}
run: |
chmod +x ci/build-frontend.sh
VERSION="${REF_NAME#v}" ci/build-frontend.sh
- uses: actions/upload-artifact@v4
with:
name: frontend
path: dist/frontend-*.tar.gz
# ------------------------------------------------------------------
# Backend: package Python source
# ------------------------------------------------------------------
build-backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Package backend
env:
REF_NAME: ${{ github.ref_name }}
run: |
chmod +x ci/build-backend.sh
VERSION="${REF_NAME#v}" ci/build-backend.sh
- uses: actions/upload-artifact@v4
with:
name: backend
path: dist/backend-*.tar.gz
# ------------------------------------------------------------------
# Theme: build token CSS from design system
# ------------------------------------------------------------------
build-theme:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout design system
uses: actions/checkout@v4
with:
repository: dangerous-tacos/dt-design-system
path: dt-design-system
- uses: actions/setup-node@v4
with:
node-version: '18'
- name: Build theme
env:
REF_NAME: ${{ github.ref_name }}
run: |
chmod +x ci/build-theme.sh
VERSION="${REF_NAME#v}" \
DESIGN_SYSTEM_DIR="${GITHUB_WORKSPACE}/dt-design-system" \
ci/build-theme.sh
- uses: actions/upload-artifact@v4
with:
name: theme
path: dist/theme-*.tar.gz
# ------------------------------------------------------------------
# Create release with all component assets
# ------------------------------------------------------------------
create-release:
needs: [build-pm3, build-frontend, build-backend, build-theme]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: actions/download-artifact@v4
with:
path: dist/
merge-multiple: true
- name: Generate release manifest
env:
REF_NAME: ${{ github.ref_name }}
run: |
python3 ci/generate-manifest.py dist/ \
--version "${REF_NAME#v}"
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
dist/*.tar.gz
dist/release-manifest.json
generate_release_notes: true