Some checks failed
Build Godot Engine / Build Windows ${{ matrix.name }} (godot-windows-debug, Debug Template, no, template_debug) (push) Failing after 22m24s
Build Godot Engine / Build Windows ${{ matrix.name }} (godot-windows-release, Release Template, yes, template_release) (push) Has been cancelled
Build Godot Engine / Build Windows ${{ matrix.name }} (godot-windows-editor, Editor, yes, editor) (push) Has been cancelled
101 lines
3.3 KiB
YAML
101 lines
3.3 KiB
YAML
name: Build Godot Engine
|
|
on:
|
|
push:
|
|
branches: [ "customized-moa" ]
|
|
create:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
build-windows:
|
|
name: Build Windows ${{ matrix.name }}
|
|
runs-on: ubuntu-latest
|
|
|
|
# Run the entire job inside your new builder container
|
|
container:
|
|
image: gitea.212.63.210.91.nip.io/${{ gitea.repository_owner }}/godot-builder:1b1355e7829467917b66c582268b26159d8ae21c
|
|
# Credentials are required to pull from your private registry
|
|
credentials:
|
|
username: ${{ gitea.actor }}
|
|
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.
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
# 1. The Editor (The IDE)
|
|
- name: Editor
|
|
target: editor
|
|
production: yes
|
|
artifact_name: godot-windows-editor
|
|
|
|
# 2. Debug Template (For testing game logic)
|
|
- name: Debug Template
|
|
target: template_debug
|
|
production: no
|
|
artifact_name: godot-windows-debug
|
|
|
|
# 3. Release Template (For final export)
|
|
- name: Release Template
|
|
target: template_release
|
|
production: yes
|
|
artifact_name: godot-windows-release
|
|
|
|
steps:
|
|
- name: Checkout Source
|
|
uses: actions/checkout@v3
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Compile with SCons
|
|
run: |
|
|
# --- SMART CORE DETECTION ---
|
|
# Default to hardware limit if no quota is found
|
|
REAL_CORES=$(nproc)
|
|
|
|
# Check Cgroup V2 (Fedora / Modern K8s)
|
|
if [ -f /sys/fs/cgroup/cpu.max ]; then
|
|
# Read quota and period (e.g., "700000 100000")
|
|
read QUOTA PERIOD < /sys/fs/cgroup/cpu.max
|
|
if [ "$QUOTA" != "max" ]; then
|
|
# Calculate limit: Quota / Period (e.g., 700000 / 100000 = 7)
|
|
REAL_CORES=$(( QUOTA / PERIOD ))
|
|
fi
|
|
|
|
# Check Cgroup V1 (Older K8s / Docker)
|
|
elif [ -f /sys/fs/cgroup/cpu/cpu.cfs_quota_us ]; then
|
|
QUOTA=$(cat /sys/fs/cgroup/cpu/cpu.cfs_quota_us)
|
|
PERIOD=$(cat /sys/fs/cgroup/cpu/cpu.cfs_period_us)
|
|
if [ "$QUOTA" -gt 0 ]; then
|
|
REAL_CORES=$(( QUOTA / PERIOD ))
|
|
fi
|
|
fi
|
|
|
|
# Safety: Ensure we use at least 1 core
|
|
if [ "$REAL_CORES" -lt 1 ]; then REAL_CORES=1; fi
|
|
|
|
echo "Hardware has $(nproc) cores. Container limit is ${REAL_CORES} cores."
|
|
# -----------------------------
|
|
|
|
echo "Compiling ${{ matrix.name }}..."
|
|
|
|
# Godot 4 SCons Command
|
|
nice -n 10 scons platform=windows \
|
|
target=${{ matrix.target }} \
|
|
d3d12=no \
|
|
arch=x86_64 \
|
|
precision=double \
|
|
production=${{ matrix.production }} \
|
|
LINKFLAGS="-lhid -lsetupapi" \
|
|
-j$REAL_CORES
|
|
|
|
- name: Verify Output
|
|
run: ls -l bin/
|
|
|
|
- name: Upload Artifacts
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: ${{ matrix.artifact_name }}
|
|
# Corrected from *.dll to *.exe (Godot templates are executables)
|
|
path: bin/*.exe |