Compare commits
39 Commits
master
...
feature/po
| Author | SHA1 | Date | |
|---|---|---|---|
| 1e568533ba | |||
| 200cb5fbb1 | |||
| 971b9cab41 | |||
| 63660c3158 | |||
| efca38acff | |||
| cbddae7b2b | |||
| 6cce0a367f | |||
| eabc4fec3f | |||
| 659e3c4179 | |||
| 6d2750552b | |||
| b822c79d6b | |||
| dc9f008a24 | |||
| 9dca4a4460 | |||
| f33f851cb8 | |||
| e40804a4ae | |||
| 8787924648 | |||
| d212c80f06 | |||
| a90daf08c2 | |||
| bf4cb1830e | |||
| b21a22f4b9 | |||
| 7acb86143e | |||
| 1375e0ceea | |||
| f2e1e915a3 | |||
| 54b45d1604 | |||
| 74eba5fc29 | |||
| e02da0f0dc | |||
| 87aaaee02e | |||
| fa1656ea42 | |||
| 547913c8a4 | |||
| 7358ab696e | |||
| b1d2f4bae9 | |||
| f3f03de589 | |||
| 35e204f812 | |||
| 6466e4168d | |||
| ff388b0aa1 | |||
| f9f4f1aece | |||
| b16e46f1ca | |||
| dbe1dadd20 | |||
| ce5e6a245d |
146
.gitea/workflows/build-engine.yaml
Normal file
146
.gitea/workflows/build-engine.yaml
Normal file
@ -0,0 +1,146 @@
|
||||
name: Build Godot Engine
|
||||
on:
|
||||
push:
|
||||
branches: [ "customized-moa" ]
|
||||
create:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
# --- BUILD JOBS (Parallel Matrix) ---
|
||||
build-engine:
|
||||
name: Build ${{ matrix.platform }} ${{ matrix.target }}
|
||||
runs-on: heavy-linux
|
||||
|
||||
# 1. NEW: Define the container dynamically per matrix entry
|
||||
container:
|
||||
image: registry.forge.northernlighthouseinteractive.com/${{ gitea.repository_owner }}/godot-builder-${{ matrix.builder }}:latest
|
||||
# Pull credentials (if your registry is private)
|
||||
credentials:
|
||||
username: ${{ gitea.repository_owner }}
|
||||
password: ${{ secrets.ORG_ACTIONS_TOKEN }}
|
||||
# Set resource limits for the JOB container
|
||||
options: --cpus 24 --memory 30g
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
# Windows
|
||||
- platform: windows
|
||||
target: editor
|
||||
production: yes
|
||||
artifact_name: godot-windows-editor
|
||||
builder: windows
|
||||
extra_flags: "use_mingw=yes d3d12=no"
|
||||
- platform: windows
|
||||
target: template_debug
|
||||
production: no
|
||||
artifact_name: godot-windows-debug
|
||||
builder: windows
|
||||
extra_flags: "use_mingw=yes d3d12=no"
|
||||
- platform: windows
|
||||
target: template_release
|
||||
production: yes
|
||||
artifact_name: godot-windows-release
|
||||
builder: windows
|
||||
extra_flags: "use_mingw=yes d3d12=no"
|
||||
|
||||
# Linux
|
||||
- platform: linuxbsd
|
||||
target: editor
|
||||
production: yes
|
||||
artifact_name: godot-linux-editor
|
||||
builder: linux
|
||||
- platform: linuxbsd
|
||||
target: template_debug
|
||||
production: no
|
||||
artifact_name: godot-linux-debug
|
||||
builder: linux
|
||||
- platform: linuxbsd
|
||||
target: template_release
|
||||
production: yes
|
||||
artifact_name: godot-linux-release
|
||||
builder: linux
|
||||
|
||||
steps:
|
||||
- name: Checkout Source (Native Git)
|
||||
run: |
|
||||
echo "Initializing Git..."
|
||||
git config --global --add safe.directory '*'
|
||||
git init
|
||||
|
||||
# 1. Clean the Server URL using shell commands
|
||||
# We strip both http:// and https:// to be safe
|
||||
SERVER_DOMAIN=$(echo "${{ gitea.server_url }}" | sed 's|https://||' | sed 's|http://||')
|
||||
|
||||
# 2. Add Remote with Token Auth
|
||||
# We use the $SERVER_DOMAIN variable we just created
|
||||
git remote add origin "https://${{ gitea.actor }}:${{ secrets.ORG_ACTIONS_TOKEN }}@$SERVER_DOMAIN/${{ gitea.repository }}.git"
|
||||
|
||||
# 3. Fetch specific commit
|
||||
echo "Fetching commit ${{ gitea.sha }}..."
|
||||
git fetch --depth 1 origin ${{ gitea.sha }}
|
||||
git checkout FETCH_HEAD
|
||||
|
||||
# 4. Handle Submodules
|
||||
echo "Updating submodules..."
|
||||
# Configure git to use credentials for submodules on the same domain
|
||||
git config --global url."https://${{ gitea.actor }}:${{ secrets.ORG_ACTIONS_TOKEN }}@$SERVER_DOMAIN/".insteadOf "https://$SERVER_DOMAIN/"
|
||||
|
||||
git submodule update --init --recursive
|
||||
|
||||
# 2. UPDATED: No more 'buildah' script. Run SCons directly.
|
||||
- name: Compile (${{ matrix.platform }})
|
||||
run: |
|
||||
echo "Starting Native Build..."
|
||||
|
||||
# Use the injected limit, fallback to nproc if missing
|
||||
THREADS=${MAX_CORES:-$(nproc)}
|
||||
|
||||
echo "Building for ${{ matrix.platform }} (Target: ${{ matrix.target }}) with $THREADS threads."
|
||||
|
||||
# Base SCons command
|
||||
# Note: We construct flags dynamically based on the matrix variables
|
||||
scons platform=${{ matrix.platform }} \
|
||||
target=${{ matrix.target }} \
|
||||
arch=x86_64 \
|
||||
precision=double \
|
||||
production=${{ matrix.production }} \
|
||||
${{ matrix.extra_flags }} \
|
||||
-j$THREADS
|
||||
|
||||
- name: Upload Artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ matrix.artifact_name }}
|
||||
path: bin/godot.*
|
||||
|
||||
# --- PUBLISH JOB ---
|
||||
publish:
|
||||
needs: build-engine
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Source
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Download All Artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
path: dist
|
||||
|
||||
- name: Make script executable
|
||||
run: chmod +x .gitea/workflows/scripts/publish.sh
|
||||
|
||||
- name: Package and Publish
|
||||
uses: docker://alpine:latest
|
||||
env:
|
||||
API_URL: https://registry.forge.northernlighthouseinteractive.com/api/packages/${{ gitea.repository_owner }}/generic
|
||||
TOKEN: ${{ secrets.ORG_ACTIONS_TOKEN }}
|
||||
ACTOR: ${{ gitea.repository_owner }}
|
||||
VERSION: ${{ gitea.sha }}-${{ gitea.run_number }}
|
||||
with:
|
||||
entrypoint: /bin/sh
|
||||
args: .gitea/workflows/scripts/publish.sh
|
||||
49
.gitea/workflows/scripts/build-with-buildah.sh
Normal file
49
.gitea/workflows/scripts/build-with-buildah.sh
Normal file
@ -0,0 +1,49 @@
|
||||
#!/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 --storage-driver=vfs --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${MAX_CORES:-$(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 --storage-driver=vfs --workingdir /src "$CTR"
|
||||
|
||||
echo "Running: scons $SCONS_FLAGS"
|
||||
|
||||
# 5. Run Build
|
||||
buildah run \
|
||||
--storage-driver=vfs \
|
||||
--volume "$PWD":/src \
|
||||
"$CTR" \
|
||||
scons $SCONS_FLAGS
|
||||
|
||||
echo "✅ Build Complete"
|
||||
48
.gitea/workflows/scripts/publish.sh
Normal file
48
.gitea/workflows/scripts/publish.sh
Normal file
@ -0,0 +1,48 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
# Install tools (Alpine container)
|
||||
apk add --no-cache curl zip
|
||||
|
||||
echo "------------------------------------------------"
|
||||
echo "Publishing Packages for Version: $VERSION"
|
||||
echo "------------------------------------------------"
|
||||
|
||||
# --- 1. WINDOWS EDITOR ---
|
||||
echo "Packaging Windows Editor..."
|
||||
zip -j godot-editor-windows.zip dist/godot-windows-editor/*.exe
|
||||
|
||||
curl --fail --user "$ACTOR:$TOKEN" \
|
||||
--upload-file "godot-editor-windows.zip" \
|
||||
"$API_URL/godot-editor-windows/$VERSION/godot-editor-windows.zip"
|
||||
|
||||
# --- 2. LINUX EDITOR ---
|
||||
echo "Packaging Linux Editor..."
|
||||
# Find the linux binary (it has no extension, so we grep for 'godot.')
|
||||
LINUX_BIN=$(find dist/godot-linux-editor -type f -name "godot.linuxbsd.editor*" | head -n 1)
|
||||
zip -j godot-editor-linux.zip "$LINUX_BIN"
|
||||
|
||||
curl --fail --user "$ACTOR:$TOKEN" \
|
||||
--upload-file "godot-editor-linux.zip" \
|
||||
"$API_URL/godot-editor-linux/$VERSION/godot-editor-linux.zip"
|
||||
|
||||
# --- 3. EXPORT TEMPLATES (Windows + Linux) ---
|
||||
echo "Packaging Templates (.tpz)..."
|
||||
mkdir -p templates
|
||||
|
||||
# Windows Templates (Filter out console wrapper)
|
||||
cp $(ls dist/godot-windows-debug/*.exe | grep -v "console") templates/windows_debug_x86_64.exe
|
||||
cp $(ls dist/godot-windows-release/*.exe | grep -v "console") templates/windows_release_x86_64.exe
|
||||
|
||||
# Linux Templates
|
||||
cp $(find dist/godot-linux-debug -type f -name "godot.*") templates/linux_debug.x86_64
|
||||
cp $(find dist/godot-linux-release -type f -name "godot.*") templates/linux_release.x86_64
|
||||
|
||||
# Create TPZ
|
||||
zip -j templates.tpz templates/*
|
||||
|
||||
curl --fail --user "$ACTOR:$TOKEN" \
|
||||
--upload-file "templates.tpz" \
|
||||
"$API_URL/godot-templates/$VERSION/templates.tpz"
|
||||
|
||||
echo "✅ All packages published successfully!"
|
||||
Reference in New Issue
Block a user