Scons patching and linux build
Some checks failed
Build Godot Engine / Build Windows ${{ matrix.name }} (godot-linux-editor, , Linux Editor, linuxbsd, yes, editor) (push) Failing after 35m4s
Build Godot Engine / Build Windows ${{ matrix.name }} (godot-windows-debug, Debug Template, no, template_debug) (push) Failing after 22m19s
Build Godot Engine / Build Windows ${{ matrix.name }} (godot-windows-editor, Editor, yes, editor) (push) Failing after 34m48s
Build Godot Engine / Build Windows ${{ matrix.name }} (godot-windows-release, Release Template, yes, template_release) (push) Failing after 23m34s

This commit is contained in:
2025-12-01 23:15:17 +01:00
parent 35e204f812
commit f3f03de589

View File

@ -1,16 +1,16 @@
name: Build Godot Engine name: Build Godot Engine
on: on:
push: push:
branches: [ "customized-moa" ] branches: ["customized-moa"]
create: create:
tags: tags:
- 'v*' - "v*"
jobs: jobs:
build-windows: build-windows:
name: Build Windows ${{ matrix.name }} name: Build Windows ${{ matrix.name }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
# Run the entire job inside your new builder container # Run the entire job inside your new builder container
container: container:
image: gitea.212.63.210.91.nip.io/${{ gitea.repository_owner }}/godot-builder:1b1355e7829467917b66c582268b26159d8ae21c image: gitea.212.63.210.91.nip.io/${{ gitea.repository_owner }}/godot-builder:1b1355e7829467917b66c582268b26159d8ae21c
@ -19,24 +19,34 @@ jobs:
username: ${{ gitea.actor }} username: ${{ gitea.actor }}
password: ${{ secrets.USER_PACKAGE_PASSWORD }} password: ${{ secrets.USER_PACKAGE_PASSWORD }}
# Note: If this fails to pull due to SSL, we may need to use a 'docker run' step approach instead. # Note: If this fails to pull due to SSL, we may need to use a 'docker run' step approach instead.
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
include: include:
# 1. The Editor (The IDE) # Linux Editor Build (Easy Mode)
- name: Linux Editor
target: editor
# platform=linuxbsd is the key
platform: linuxbsd
production: yes
artifact_name: godot-linux-editor
# Linux builds don't use the .exe extension
ext: ""
# Windows Editor
- name: Editor - name: Editor
target: editor target: editor
production: yes production: yes
artifact_name: godot-windows-editor artifact_name: godot-windows-editor
# 2. Debug Template (For testing game logic) # Windows Debug Template (For testing game logic)
- name: Debug Template - name: Debug Template
target: template_debug target: template_debug
production: no production: no
artifact_name: godot-windows-debug artifact_name: godot-windows-debug
# 3. Release Template (For final export) # Windows Release Template (For final export)
- name: Release Template - name: Release Template
target: template_release target: template_release
production: yes production: yes
@ -48,12 +58,22 @@ jobs:
with: with:
submodules: recursive submodules: recursive
# NEW STEP: Patch the build file to force linking HID
- name: Patch SCons for Fedora
run: |
# Find the line defining LIBS and inject 'hid' and 'setupapi'
# This ensures they come AFTER the object files
sed -i "s/env.Append(LIBS=\['mingw32'/env.Append(LIBS=\['mingw32', 'hid', 'setupapi'/" platform/windows/detect.py
# Optional: Verify the change
grep "env.Append(LIBS=" platform/windows/detect.py
- name: Compile with SCons - name: Compile with SCons
run: | run: |
# --- SMART CORE DETECTION --- # --- SMART CORE DETECTION ---
# Default to hardware limit if no quota is found # Default to hardware limit if no quota is found
REAL_CORES=$(nproc) REAL_CORES=$(nproc)
# Check Cgroup V2 (Fedora / Modern K8s) # Check Cgroup V2 (Fedora / Modern K8s)
if [ -f /sys/fs/cgroup/cpu.max ]; then if [ -f /sys/fs/cgroup/cpu.max ]; then
# Read quota and period (e.g., "700000 100000") # Read quota and period (e.g., "700000 100000")
@ -62,7 +82,7 @@ jobs:
# Calculate limit: Quota / Period (e.g., 700000 / 100000 = 7) # Calculate limit: Quota / Period (e.g., 700000 / 100000 = 7)
REAL_CORES=$(( QUOTA / PERIOD )) REAL_CORES=$(( QUOTA / PERIOD ))
fi fi
# Check Cgroup V1 (Older K8s / Docker) # Check Cgroup V1 (Older K8s / Docker)
elif [ -f /sys/fs/cgroup/cpu/cpu.cfs_quota_us ]; then elif [ -f /sys/fs/cgroup/cpu/cpu.cfs_quota_us ]; then
QUOTA=$(cat /sys/fs/cgroup/cpu/cpu.cfs_quota_us) QUOTA=$(cat /sys/fs/cgroup/cpu/cpu.cfs_quota_us)
@ -71,15 +91,15 @@ jobs:
REAL_CORES=$(( QUOTA / PERIOD )) REAL_CORES=$(( QUOTA / PERIOD ))
fi fi
fi fi
# Safety: Ensure we use at least 1 core # Safety: Ensure we use at least 1 core
if [ "$REAL_CORES" -lt 1 ]; then REAL_CORES=1; fi if [ "$REAL_CORES" -lt 1 ]; then REAL_CORES=1; fi
echo "Hardware has $(nproc) cores. Container limit is ${REAL_CORES} cores." echo "Hardware has $(nproc) cores. Container limit is ${REAL_CORES} cores."
# ----------------------------- # -----------------------------
echo "Compiling ${{ matrix.name }}..." echo "Compiling ${{ matrix.name }}..."
# Godot 4 SCons Command # Godot 4 SCons Command
nice -n 10 scons platform=windows \ nice -n 10 scons platform=windows \
target=${{ matrix.target }} \ target=${{ matrix.target }} \
@ -98,4 +118,4 @@ jobs:
with: with:
name: ${{ matrix.artifact_name }} name: ${{ matrix.artifact_name }}
# Corrected from *.dll to *.exe (Godot templates are executables) # Corrected from *.dll to *.exe (Godot templates are executables)
path: bin/*.exe path: bin/*.exe