Skip to content

Commit 330af29

Browse files
committed
Build for Raspberry Pi using ARM runner
1 parent 977915d commit 330af29

File tree

1 file changed

+69
-1
lines changed

1 file changed

+69
-1
lines changed

.github/workflows/build.yml

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,12 @@ jobs:
9191
name: Build on Native Runner (target OS/CPU = source OS/CPU)
9292
strategy:
9393
matrix:
94-
runner: [macos_x64, raspberry_pi_64, raspberry_pi_32]
94+
runner: [
95+
macos_x64
96+
# We use arm-runner for Raspberry Pi builds now, to not have costs of maintaining our own runners.
97+
# raspberry_pi_64,
98+
# raspberry_pi_32
99+
]
95100
runs-on: ${{ matrix.runner }}
96101
steps:
97102
- uses: actions/checkout@v4
@@ -138,6 +143,69 @@ jobs:
138143
*.tar.gz
139144
#if-no-files-found: error
140145

146+
build_arm_runner:
147+
name: Build on ARM Runner (for Raspberry Pi)
148+
runs-on: ubuntu-latest
149+
strategy:
150+
matrix:
151+
arch: [armv7l, aarch64]
152+
include:
153+
# Raspberry Pi 32-bit (Arm), bullseye (older version, used on Raspberry Pi 4 by default)
154+
- arch: armv7l
155+
cpu: cortex-a7
156+
base_image: dietpi:rpi_armv7_bullseye
157+
# Raspberry Pi 64-bit (Aarch64), latest (bookworm)
158+
- arch: aarch64
159+
cpu: cortex-a53
160+
base_image: raspios_lite_arm64:latest
161+
steps:
162+
- uses: actions/checkout@v4
163+
- uses: pguyot/arm-runner-action@v2
164+
with:
165+
base_image: ${{ matrix.base_image }}
166+
cpu: ${{ matrix.cpu }}
167+
shell: /bin/bash -eo pipefail
168+
image_additional_mb: 6000
169+
# Avoids the need for copy_artifact_path later.
170+
bind_mount_repository: true
171+
commands: |
172+
# Useful string to grep logs, because log of script execution is somewhat buried in the middle of pguyot/arm-runner-action log
173+
echo 'CGE script starts here'
174+
175+
# Show system info
176+
uname -a
177+
178+
# Install FPC and other Linux dependencies
179+
sudo apt-get update
180+
sudo apt-get --no-install-recommends -y install libgl-dev fpc git make unzip sed zip
181+
182+
# Check versions (and availability) of our requirements early
183+
fpc -iV
184+
make --version
185+
sed --version
186+
187+
# Setup Castle Game Engine
188+
ARM_RUNNER_WORKSPACE=`pwd`
189+
export "CASTLE_ENGINE_PATH=$ARM_RUNNER_WORKSPACE/castle-engine"
190+
export "PATH=$PATH:$CASTLE_ENGINE_PATH/tools/build-tool/"
191+
git clone --depth 1 --single-branch --branch ${{ env.engine_tag }} https://github.com/castle-engine/castle-engine/
192+
cd $CASTLE_ENGINE_PATH/tools/build-tool/
193+
./castle-engine_compile.sh
194+
cd $ARM_RUNNER_WORKSPACE
195+
196+
# Package application
197+
castle-engine compile --manifest-name=CastleEngineManifest.converter.xml
198+
castle-engine package
199+
200+
- name: Archive Artifacts
201+
uses: actions/upload-artifact@v4
202+
with:
203+
name: raspberry-pi-${{ matrix.runner }}-build
204+
path: |
205+
*.zip
206+
*.tar.gz
207+
#if-no-files-found: error
208+
141209
release:
142210
name: Release
143211
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)