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:
51
ci/build-frontend.sh
Executable file
51
ci/build-frontend.sh
Executable file
@@ -0,0 +1,51 @@
|
||||
#!/usr/bin/env bash
|
||||
# Build the Remix frontend and package it for distribution.
|
||||
#
|
||||
# Environment variables:
|
||||
# OUTPUT_DIR - where to write the tarball (default: ./dist)
|
||||
# VERSION - version string (default: read from VERSION file)
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
WORKSPACE="${SCRIPT_DIR}/.."
|
||||
OUTPUT_DIR="${OUTPUT_DIR:-${WORKSPACE}/dist}"
|
||||
VERSION="${VERSION:-$(cat "${WORKSPACE}/VERSION" 2>/dev/null || echo "0.1.0")}"
|
||||
FRONTEND_DIR="${WORKSPACE}/app/frontend"
|
||||
|
||||
echo "=== Dangerous Pi Frontend Build ==="
|
||||
echo "Version: ${VERSION}"
|
||||
|
||||
cd "$FRONTEND_DIR"
|
||||
|
||||
# Install dependencies (including dev for build)
|
||||
npm ci --production=false
|
||||
|
||||
# Build Remix app
|
||||
npm run build
|
||||
|
||||
# Remove dev dependencies after build
|
||||
npm prune --production
|
||||
|
||||
# Package
|
||||
STAGING="/tmp/frontend-staging/frontend"
|
||||
rm -rf /tmp/frontend-staging
|
||||
mkdir -p "$STAGING"
|
||||
|
||||
cp -r build/ "$STAGING/"
|
||||
|
||||
cat > "${STAGING}/COMPONENT_VERSION" << EOF
|
||||
{
|
||||
"component_id": "frontend",
|
||||
"version": "${VERSION}",
|
||||
"build_date": "$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
|
||||
}
|
||||
EOF
|
||||
|
||||
mkdir -p "$OUTPUT_DIR"
|
||||
TARBALL="frontend-${VERSION}.tar.gz"
|
||||
cd /tmp/frontend-staging
|
||||
tar -czf "${OUTPUT_DIR}/${TARBALL}" frontend/
|
||||
echo "✅ Built: ${OUTPUT_DIR}/${TARBALL}"
|
||||
|
||||
rm -rf /tmp/frontend-staging
|
||||
Reference in New Issue
Block a user