All checks were successful
Build Raspberry Pi Binary / build-arm64 (push) Successful in 12m49s
85 lines
2.6 KiB
YAML
85 lines
2.6 KiB
YAML
name: Build Raspberry Pi Binary
|
|
on: [push, workflow_dispatch]
|
|
|
|
jobs:
|
|
build-arm64:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v2
|
|
with:
|
|
platforms: linux/arm64
|
|
|
|
- name: Build in Docker (ARM64)
|
|
run: |
|
|
# Create a Dockerfile for the build to avoid volume mount issues
|
|
cat <<EOF > Dockerfile.arm64
|
|
FROM python:3.11-bookworm
|
|
|
|
WORKDIR /app
|
|
|
|
# Install System Dependencies
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
libgl1 \
|
|
libegl1 \
|
|
libxkbcommon-x11-0 \
|
|
libdbus-1-3 \
|
|
libfontconfig1 \
|
|
binutils
|
|
|
|
# Copy project files
|
|
COPY . /app
|
|
|
|
# Install Python Dependencies
|
|
RUN pip install --upgrade pip && \
|
|
pip install -r requirements.txt
|
|
|
|
# Build with PyInstaller
|
|
RUN pyinstaller --name "volvodisplay" \
|
|
--onefile \
|
|
--windowed \
|
|
--clean \
|
|
--noconfirm \
|
|
--add-data "main.qml:." \
|
|
--add-data "TemperatureGauge.qml:." \
|
|
--exclude-module PySide6.QtWebEngineQuick \
|
|
--exclude-module PySide6.QtWebEngineCore \
|
|
--exclude-module PySide6.QtQuick3DSpatialAudio \
|
|
main.py
|
|
|
|
# Prepare config for export
|
|
RUN cp config.json dist/
|
|
EOF
|
|
|
|
echo "Building Docker image..."
|
|
docker build --platform linux/arm64 -f Dockerfile.arm64 -t volvo-builder .
|
|
|
|
echo "Extracting artifacts..."
|
|
# Create a container just to copy files out
|
|
CONTAINER_ID=$(docker create --platform linux/arm64 volvo-builder)
|
|
|
|
# Ensure local dist directory exists
|
|
mkdir -p dist
|
|
|
|
# Copy binary and config from the container to host
|
|
docker cp $CONTAINER_ID:/app/dist/volvodisplay dist/volvodisplay
|
|
docker cp $CONTAINER_ID:/app/dist/config.json dist/config.json
|
|
|
|
# Cleanup
|
|
docker rm $CONTAINER_ID
|
|
|
|
- name: Upload Binary
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: volvodisplay-arm64
|
|
path: dist/volvodisplay
|
|
|
|
- name: Upload Config
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: config
|
|
path: dist/config.json
|