Files
godot/.gitea/workflows/scripts/build-with-buildah.sh
Olof Pettersson e40804a4ae
All checks were successful
Build Godot Engine / Build ${{ matrix.platform }} ${{ matrix.target }} (godot-linux-debug, linux, linuxbsd, no, template_debug) (push) Successful in 18m0s
Build Godot Engine / Build ${{ matrix.platform }} ${{ matrix.target }} (godot-linux-editor, linux, linuxbsd, yes, editor) (push) Successful in 27m43s
Build Godot Engine / Build ${{ matrix.platform }} ${{ matrix.target }} (godot-linux-release, linux, linuxbsd, yes, template_release) (push) Successful in 18m6s
Build Godot Engine / Build ${{ matrix.platform }} ${{ matrix.target }} (godot-windows-debug, windows, windows, no, template_debug) (push) Successful in 23m21s
Build Godot Engine / Build ${{ matrix.platform }} ${{ matrix.target }} (godot-windows-editor, windows, windows, yes, editor) (push) Successful in 35m48s
Build Godot Engine / Build ${{ matrix.platform }} ${{ matrix.target }} (godot-windows-release, windows, windows, yes, template_release) (push) Successful in 24m1s
Build Godot Engine / publish (push) Successful in 1m41s
Fix config storage drive
2025-12-03 21:47:51 +01:00

47 lines
1.4 KiB
Bash

#!/bin/sh
set -e
# --- Configuration ---
FULL_IMAGE_URL="$REGISTRY/$OWNER/godot-builder-$BUILDER_TYPE:$IMAGE_TAG"
echo "------------------------------------------------"
echo "Starting Build for: $PLATFORM / $TARGET"
echo "Using Builder: $FULL_IMAGE_URL"
echo "------------------------------------------------"
echo "Logging into registry..."
# Note: We use --password-stdin for security so the secret isn't in process list
echo "$PASSWORD" | buildah login -u "$USERNAME" --password-stdin --tls-verify=false "$REGISTRY"
echo "Pulling image and creating working container..."
# We capture the Container ID (CTR)
CTR=$(buildah from --tls-verify=false "$FULL_IMAGE_URL")
# 3. Clean up on exit (Trap)
cleanup() {
echo "Cleaning up container..."
buildah rm "$CTR" || true
}
trap cleanup EXIT
# 4. Determine SCons Flags based on Platform
# Windows needs LLVM/MinGW flags. Linux just needs defaults.
SCONS_FLAGS="platform=$PLATFORM target=$TARGET arch=x86_64 precision=double production=$PRODUCTION -j$(nproc)"
if [ "$PLATFORM" = "windows" ]; then
# Add Windows-specific flags (LLVM toolchain, disable D3D12)
SCONS_FLAGS="$SCONS_FLAGS use_llvm=yes use_mingw=yes d3d12=no"
fi
# We use 'buildah config' to set it on the container instance instead.
buildah config --workingdir /src "$CTR"
echo "Running: scons $SCONS_FLAGS"
# 5. Run Build
buildah run \
--volume "$PWD":/src \
"$CTR" \
scons $SCONS_FLAGS
echo "✅ Build Complete"