Build linux editor and templates
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
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
This commit is contained in:
@ -2,29 +2,52 @@ name: Build Godot Engine
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "customized-moa" ]
|
branches: [ "customized-moa" ]
|
||||||
|
create:
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-windows:
|
# --- BUILD JOBS (Parallel Matrix) ---
|
||||||
name: Build Windows ${{ matrix.name }}
|
build-engine:
|
||||||
|
name: Build ${{ matrix.platform }} ${{ matrix.target }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
# Run on Host (so Checkout works)
|
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- name: Editor
|
# Windows (Double Precision)
|
||||||
|
- platform: windows
|
||||||
target: editor
|
target: editor
|
||||||
production: yes
|
production: yes
|
||||||
artifact_name: godot-windows-editor
|
artifact_name: godot-windows-editor
|
||||||
- name: Debug Template
|
builder: windows
|
||||||
|
- platform: windows
|
||||||
target: template_debug
|
target: template_debug
|
||||||
production: no
|
production: no
|
||||||
artifact_name: godot-windows-debug
|
artifact_name: godot-windows-debug
|
||||||
- name: Release Template
|
builder: windows
|
||||||
|
- platform: windows
|
||||||
target: template_release
|
target: template_release
|
||||||
production: yes
|
production: yes
|
||||||
artifact_name: godot-windows-release
|
artifact_name: godot-windows-release
|
||||||
|
builder: windows
|
||||||
|
|
||||||
|
# Linux (Double Precision)
|
||||||
|
- 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:
|
steps:
|
||||||
- name: Checkout Source
|
- name: Checkout Source
|
||||||
@ -32,33 +55,40 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: Compile with SCons
|
- name: Make scripts executable
|
||||||
|
run: chmod +x .gitea/workflows/scripts/*.sh
|
||||||
|
|
||||||
|
- name: Compile (${{ matrix.platform }})
|
||||||
uses: docker://quay.io/buildah/stable
|
uses: docker://quay.io/buildah/stable
|
||||||
env:
|
env:
|
||||||
|
# Registry Config
|
||||||
REGISTRY: gitea.212.63.210.91.nip.io
|
REGISTRY: gitea.212.63.210.91.nip.io
|
||||||
OWNER: ${{ gitea.repository_owner }}
|
OWNER: ${{ gitea.repository_owner }}
|
||||||
IMAGE_NAME: godot-builder-windows
|
|
||||||
IMAGE_TAG: 513d6efc259bb974ee2078adfa5f0994d0796a57
|
|
||||||
USERNAME: ${{ gitea.actor }}
|
USERNAME: ${{ gitea.actor }}
|
||||||
PASSWORD: ${{ secrets.USER_PACKAGE_PASSWORD }}
|
PASSWORD: ${{ secrets.USER_PACKAGE_PASSWORD }}
|
||||||
# Build Arguments (From Matrix)
|
|
||||||
PLATFORM: windows
|
# Which builder image to use? (windows or linux)
|
||||||
|
BUILDER_TYPE: ${{ matrix.builder }}
|
||||||
|
IMAGE_TAG: latest
|
||||||
|
|
||||||
|
# SCons Arguments
|
||||||
|
PLATFORM: ${{ matrix.platform }}
|
||||||
TARGET: ${{ matrix.target }}
|
TARGET: ${{ matrix.target }}
|
||||||
PRODUCTION: ${{ matrix.production }}
|
PRODUCTION: ${{ matrix.production }}
|
||||||
with:
|
with:
|
||||||
entrypoint: /bin/sh
|
entrypoint: /bin/sh
|
||||||
# Just run the file! No messy YAML strings.
|
|
||||||
args: .gitea/workflows/scripts/build-with-buildah.sh
|
args: .gitea/workflows/scripts/build-with-buildah.sh
|
||||||
|
|
||||||
- name: Upload Artifacts
|
- name: Upload Artifacts
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.artifact_name }}
|
name: ${{ matrix.artifact_name }}
|
||||||
path: bin/*.exe
|
# Uploads executables (Windows) and binaries (Linux has no extension)
|
||||||
|
path: bin/godot.*
|
||||||
|
|
||||||
# --- JOB 2: PUBLISH (Serial) ---
|
# --- PUBLISH JOB (Runs after all builds finish) ---
|
||||||
publish:
|
publish:
|
||||||
needs: build-windows
|
needs: build-engine
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Source
|
- name: Checkout Source
|
||||||
@ -71,15 +101,16 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: dist
|
path: dist
|
||||||
|
|
||||||
|
- name: Make script executable
|
||||||
|
run: chmod +x .gitea/workflows/scripts/publish.sh
|
||||||
|
|
||||||
- name: Package and Publish
|
- name: Package and Publish
|
||||||
uses: docker://alpine:latest
|
uses: docker://alpine:latest
|
||||||
env:
|
env:
|
||||||
# Pass config & secrets
|
|
||||||
API_URL: https://gitea.212.63.210.91.nip.io/api/packages/${{ gitea.repository_owner }}/generic
|
API_URL: https://gitea.212.63.210.91.nip.io/api/packages/${{ gitea.repository_owner }}/generic
|
||||||
TOKEN: ${{ secrets.USER_PACKAGE_PASSWORD }}
|
TOKEN: ${{ secrets.USER_PACKAGE_PASSWORD }}
|
||||||
ACTOR: ${{ gitea.actor }}
|
ACTOR: ${{ gitea.actor }}
|
||||||
VERSION: ${{ gitea.sha }}
|
VERSION: ${{ gitea.sha }}
|
||||||
with:
|
with:
|
||||||
entrypoint: /bin/sh
|
entrypoint: /bin/sh
|
||||||
# The workspace (containing 'dist' and 'scripts') is automatically mounted
|
|
||||||
args: .gitea/workflows/scripts/publish.sh
|
args: .gitea/workflows/scripts/publish.sh
|
||||||
@ -1,55 +1,45 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e # Exit on error
|
set -e
|
||||||
|
|
||||||
# --- 1. CONFIGURATION ---
|
# --- Configuration ---
|
||||||
# We read these from Environment Variables passed by the workflow
|
FULL_IMAGE_URL="$REGISTRY/$OWNER/godot-builder-$BUILDER_TYPE:$IMAGE_TAG"
|
||||||
# This makes the script reusable for Windows, Linux, etc.
|
|
||||||
FULL_IMAGE_URL="$REGISTRY/$OWNER/$IMAGE_NAME:$IMAGE_TAG"
|
|
||||||
|
|
||||||
echo "------------------------------------------------"
|
echo "------------------------------------------------"
|
||||||
echo "Task Runner: Starting Buildah Orchestration"
|
echo "Starting Build for: $PLATFORM / $TARGET"
|
||||||
echo "Target: $PLATFORM / $TARGET"
|
echo "Using Builder: $FULL_IMAGE_URL"
|
||||||
echo "Image: $FULL_IMAGE_URL"
|
|
||||||
echo "------------------------------------------------"
|
echo "------------------------------------------------"
|
||||||
|
|
||||||
# --- 2. LOGIN ---
|
|
||||||
echo "Logging into registry..."
|
echo "Logging into registry..."
|
||||||
# Note: We use --password-stdin for security so the secret isn't in process list
|
# 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 --storage-driver=vfs "$REGISTRY"
|
echo "$PASSWORD" | buildah login -u "$USERNAME" --password-stdin --tls-verify=false "$REGISTRY"
|
||||||
|
|
||||||
# --- 3. CREATE CONTAINER ---
|
|
||||||
echo "Pulling image and creating working container..."
|
echo "Pulling image and creating working container..."
|
||||||
# We capture the Container ID (CTR)
|
# We capture the Container ID (CTR)
|
||||||
CTR=$(buildah from --tls-verify=false --storage-driver=vfs "$FULL_IMAGE_URL")
|
CTR=$(buildah from --tls-verify=false "$FULL_IMAGE_URL")
|
||||||
|
|
||||||
# --- 4. CONFIGURE CONTAINER ---
|
# 3. Clean up on exit (Trap)
|
||||||
# FIX: buildah run doesn't have --working-dir.
|
cleanup() {
|
||||||
# We use 'buildah config' to set it on the container instance instead.
|
echo "Cleaning up container..."
|
||||||
buildah config --storage-driver=vfs --workingdir /src "$CTR"
|
buildah rm "$CTR" || true
|
||||||
|
}
|
||||||
|
trap cleanup EXIT
|
||||||
|
|
||||||
# --- 5. EXECUTE BUILD ---
|
# 4. Determine SCons Flags based on Platform
|
||||||
echo "Running SCons inside container..."
|
# Windows needs LLVM/MinGW flags. Linux just needs defaults.
|
||||||
|
SCONS_FLAGS="platform=$PLATFORM target=$TARGET arch=x86_64 precision=double production=$PRODUCTION -j$(nproc)"
|
||||||
|
|
||||||
# Explaining the flags:
|
if [ "$PLATFORM" = "windows" ]; then
|
||||||
# -v "$PWD":/src -> Mounts the host workspace (your code) into the container at /src
|
# Add Windows-specific flags (LLVM toolchain, disable D3D12)
|
||||||
# -w /src -> Sets working directory to /src
|
SCONS_FLAGS="$SCONS_FLAGS use_llvm=yes use_mingw=yes d3d12=no"
|
||||||
# --env ... -> Passes variables needed strictly for the build (optional)
|
fi
|
||||||
# scons ... -> The actual compile command
|
|
||||||
|
|
||||||
|
echo "Running: scons $SCONS_FLAGS"
|
||||||
|
|
||||||
|
# 5. Run Build
|
||||||
buildah run \
|
buildah run \
|
||||||
--volume "$PWD":/src \
|
--volume "$PWD":/src \
|
||||||
--storage-driver=vfs \
|
--working-dir /src \
|
||||||
"$CTR" \
|
"$CTR" \
|
||||||
scons platform="$PLATFORM" \
|
scons $SCONS_FLAGS
|
||||||
target="$TARGET" \
|
|
||||||
d3d12=no \
|
|
||||||
arch=x86_64 \
|
|
||||||
precision=double \
|
|
||||||
production="$PRODUCTION" \
|
|
||||||
use_llvm=yes \
|
|
||||||
use_mingw=yes \
|
|
||||||
-j$(nproc)
|
|
||||||
|
|
||||||
# --- 6. CLEANUP ---
|
echo "✅ Build Complete"
|
||||||
echo "Build successful. Removing container..."
|
|
||||||
buildah rm --storage-driver=vfs "$CTR"
|
|
||||||
@ -1,47 +1,48 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# --- 0. SETUP ---
|
# Install tools (Alpine container)
|
||||||
# We install dependencies because we are running in a minimal Alpine container
|
|
||||||
echo "Installing tools..."
|
|
||||||
apk add --no-cache curl zip
|
apk add --no-cache curl zip
|
||||||
|
|
||||||
echo "------------------------------------------------"
|
echo "------------------------------------------------"
|
||||||
echo "Publishing Packages for: $VERSION"
|
echo "Publishing Packages for Version: $VERSION"
|
||||||
echo "Registry API: $API_URL"
|
|
||||||
echo "------------------------------------------------"
|
echo "------------------------------------------------"
|
||||||
|
|
||||||
# --- 1. PUBLISH EDITOR ---
|
# --- 1. WINDOWS EDITOR ---
|
||||||
echo "Processing Editor..."
|
echo "Packaging Windows Editor..."
|
||||||
# Zip both .exe and .console.exe
|
|
||||||
zip -j godot-editor-windows.zip dist/godot-windows-editor/*.exe
|
zip -j godot-editor-windows.zip dist/godot-windows-editor/*.exe
|
||||||
|
|
||||||
echo "Uploading Editor..."
|
|
||||||
curl --fail --user "$ACTOR:$TOKEN" \
|
curl --fail --user "$ACTOR:$TOKEN" \
|
||||||
--upload-file "godot-editor-windows.zip" \
|
--upload-file "godot-editor-windows.zip" \
|
||||||
"$API_URL/godot-editor-windows/$VERSION/godot-editor-windows.zip"
|
"$API_URL/godot-editor-windows/$VERSION/godot-editor-windows.zip"
|
||||||
|
|
||||||
# --- 2. PUBLISH TEMPLATES ---
|
# --- 2. LINUX EDITOR ---
|
||||||
echo "Processing Templates..."
|
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
|
mkdir -p templates
|
||||||
|
|
||||||
# Select specific binaries (ignoring console wrapper)
|
# Windows Templates (Filter out console wrapper)
|
||||||
DEBUG_SRC=$(find dist/godot-windows-debug -name "*.exe" | grep -v "console.exe" | head -n 1)
|
cp $(ls dist/godot-windows-debug/*.exe | grep -v "console") templates/windows_debug_x86_64.exe
|
||||||
RELEASE_SRC=$(find dist/godot-windows-release -name "*.exe" | grep -v "console.exe" | head -n 1)
|
cp $(ls dist/godot-windows-release/*.exe | grep -v "console") templates/windows_release_x86_64.exe
|
||||||
|
|
||||||
echo "Found Debug: $DEBUG_SRC"
|
# Linux Templates
|
||||||
echo "Found Release: $RELEASE_SRC"
|
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
|
||||||
|
|
||||||
# Rename to standard Godot export names
|
# Create TPZ
|
||||||
cp "$DEBUG_SRC" templates/windows_debug_x86_64.exe
|
|
||||||
cp "$RELEASE_SRC" templates/windows_release_x86_64.exe
|
|
||||||
|
|
||||||
# Zip into TPZ
|
|
||||||
zip -j templates.tpz templates/*
|
zip -j templates.tpz templates/*
|
||||||
|
|
||||||
echo "Uploading Templates..."
|
|
||||||
curl --fail --user "$ACTOR:$TOKEN" \
|
curl --fail --user "$ACTOR:$TOKEN" \
|
||||||
--upload-file "templates.tpz" \
|
--upload-file "templates.tpz" \
|
||||||
"$API_URL/godot-templates/$VERSION/windows_templates.tpz"
|
"$API_URL/godot-templates/$VERSION/templates.tpz"
|
||||||
|
|
||||||
echo "✅ Success! All packages published."
|
echo "✅ All packages published successfully!"
|
||||||
Reference in New Issue
Block a user