Files
godot/.gitea/workflows/scripts/build-with-buildah.sh
Olof Pettersson d212c80f06
Some checks failed
Build Godot Engine / Build ${{ matrix.platform }} ${{ matrix.target }} (godot-windows-release, windows, windows, yes, template_release) (push) Waiting to run
Build Godot Engine / publish (push) Blocked by required conditions
Build Godot Engine / Build ${{ matrix.platform }} ${{ matrix.target }} (godot-linux-debug, linux, linuxbsd, no, template_debug) (push) Failing after 1m35s
Build Godot Engine / Build ${{ matrix.platform }} ${{ matrix.target }} (godot-linux-editor, linux, linuxbsd, yes, editor) (push) Failing after 1m16s
Build Godot Engine / Build ${{ matrix.platform }} ${{ matrix.target }} (godot-linux-release, linux, linuxbsd, yes, template_release) (push) Failing after 1m16s
Build Godot Engine / Build ${{ matrix.platform }} ${{ matrix.target }} (godot-windows-debug, windows, windows, no, template_debug) (push) Failing after 59s
Build Godot Engine / Build ${{ matrix.platform }} ${{ matrix.target }} (godot-windows-editor, windows, windows, yes, editor) (push) Has been cancelled
Build linux editor and templates
2025-12-03 21:39:19 +01:00

45 lines
1.3 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
echo "Running: scons $SCONS_FLAGS"
# 5. Run Build
buildah run \
--volume "$PWD":/src \
--working-dir /src \
"$CTR" \
scons $SCONS_FLAGS
echo "✅ Build Complete"