|
|
|
|
@ -1,117 +1,150 @@
|
|
|
|
|
name: Build Godot Engine
|
|
|
|
|
on:
|
|
|
|
|
workflow_dispatch:
|
|
|
|
|
push:
|
|
|
|
|
branches: [ "customized-moa" ]
|
|
|
|
|
branches: [ "customized-moa", "infra/exporter-image" ]
|
|
|
|
|
create:
|
|
|
|
|
tags:
|
|
|
|
|
- 'v*'
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
# --- BUILD JOBS (Parallel Matrix) ---
|
|
|
|
|
build-engine:
|
|
|
|
|
name: Build ${{ matrix.platform }} ${{ matrix.target }}
|
|
|
|
|
runs-on: heavy-linux
|
|
|
|
|
strategy:
|
|
|
|
|
fail-fast: false
|
|
|
|
|
matrix:
|
|
|
|
|
include:
|
|
|
|
|
# Windows (Double Precision)
|
|
|
|
|
- platform: windows
|
|
|
|
|
target: editor
|
|
|
|
|
production: yes
|
|
|
|
|
artifact_name: godot-windows-editor
|
|
|
|
|
builder: windows
|
|
|
|
|
- platform: windows
|
|
|
|
|
target: template_debug
|
|
|
|
|
production: no
|
|
|
|
|
artifact_name: godot-windows-debug
|
|
|
|
|
builder: windows
|
|
|
|
|
- platform: windows
|
|
|
|
|
target: template_release
|
|
|
|
|
production: yes
|
|
|
|
|
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
|
|
|
|
|
# =================================================================
|
|
|
|
|
# JOB 1: LINUX COMPILATION (Consolidated)
|
|
|
|
|
# =================================================================
|
|
|
|
|
compile-linux:
|
|
|
|
|
name: Compile Linux (All Targets)
|
|
|
|
|
# Target your specific powerful node here
|
|
|
|
|
runs-on: heavy-linux
|
|
|
|
|
|
|
|
|
|
# Run inside the Fedora Builder image we created with Kaniko
|
|
|
|
|
container:
|
|
|
|
|
image: registry.forge.northernlighthouseinteractive.com/northern-lighthouse/godot-builder-linux:8740f6e
|
|
|
|
|
credentials:
|
|
|
|
|
username: ${{ gitea.repository_owner }}
|
|
|
|
|
password: ${{ secrets.ORG_ACTIONS_TOKEN }}
|
|
|
|
|
# Optional: Mount a host volume for SCons cache to speed up repeat builds drastically
|
|
|
|
|
volumes:
|
|
|
|
|
- /mnt/scons_cache:/root/.scons_cache
|
|
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
- name: Checkout Source
|
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
with:
|
|
|
|
|
submodules: recursive
|
|
|
|
|
|
|
|
|
|
- name: Make scripts executable
|
|
|
|
|
run: chmod +x .gitea/workflows/scripts/*.sh
|
|
|
|
|
- name: Setup Cache
|
|
|
|
|
# If you mapped the volume above, configure SCons to use it
|
|
|
|
|
run: |
|
|
|
|
|
echo "Setting up SCons Cache..."
|
|
|
|
|
export SCONS_CACHE=/root/.scons_cache
|
|
|
|
|
export SCONS_CACHE_LIMIT=5000
|
|
|
|
|
|
|
|
|
|
- name: Compile (${{ matrix.platform }})
|
|
|
|
|
uses: docker://quay.io/buildah/stable
|
|
|
|
|
env:
|
|
|
|
|
# Registry Config
|
|
|
|
|
USERNAME: ${{ gitea.repository_owner }}
|
|
|
|
|
PASSWORD: ${{ secrets.ORG_ACTIONS_TOKEN }}
|
|
|
|
|
REGISTRY: registry.forge.northernlighthouseinteractive.com
|
|
|
|
|
OWNER: ${{ gitea.repository_owner }}
|
|
|
|
|
|
|
|
|
|
# Which builder image to use? (windows or linux)
|
|
|
|
|
BUILDER_TYPE: ${{ matrix.builder }}
|
|
|
|
|
IMAGE_TAG: latest
|
|
|
|
|
- name: Compile Editor
|
|
|
|
|
run: |
|
|
|
|
|
echo "Compiling Linux Editor..."
|
|
|
|
|
scons platform=linux target=editor precision=double production=yes arch=x86_64 -j$(nproc)
|
|
|
|
|
|
|
|
|
|
# SCons Arguments
|
|
|
|
|
PLATFORM: ${{ matrix.platform }}
|
|
|
|
|
TARGET: ${{ matrix.target }}
|
|
|
|
|
PRODUCTION: ${{ matrix.production }}
|
|
|
|
|
with:
|
|
|
|
|
entrypoint: /bin/sh
|
|
|
|
|
args: .gitea/workflows/scripts/build-with-buildah.sh
|
|
|
|
|
- name: Compile Templates
|
|
|
|
|
run: |
|
|
|
|
|
echo "Compiling Linux Templates..."
|
|
|
|
|
scons platform=linux target=template_release precision=double production=yes arch=x86_64 -j$(nproc)
|
|
|
|
|
scons platform=linux target=template_debug precision=double production=yes arch=x86_64 -j$(nproc)
|
|
|
|
|
|
|
|
|
|
- name: Upload Artifacts
|
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
|
with:
|
|
|
|
|
name: ${{ matrix.artifact_name }}
|
|
|
|
|
# Uploads executables (Windows) and binaries (Linux has no extension)
|
|
|
|
|
name: linux-build-artifacts
|
|
|
|
|
path: bin/godot.*
|
|
|
|
|
|
|
|
|
|
# --- PUBLISH JOB (Runs after all builds finish) ---
|
|
|
|
|
publish:
|
|
|
|
|
needs: build-engine
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
|
|
# =================================================================
|
|
|
|
|
# JOB 2: WINDOWS COMPILATION (Consolidated)
|
|
|
|
|
# =================================================================
|
|
|
|
|
compile-windows:
|
|
|
|
|
name: Compile Windows (All Targets)
|
|
|
|
|
# You can target a DIFFERENT node here to run in parallel!
|
|
|
|
|
# e.g., runs-on: verdantforest
|
|
|
|
|
runs-on: heavy-linux
|
|
|
|
|
|
|
|
|
|
# We use the SAME Linux builder because it has MinGW for cross-compilation
|
|
|
|
|
container:
|
|
|
|
|
image: registry.forge.northernlighthouseinteractive.com/northern-lighthouse/godot-builder-windows:8740f6e
|
|
|
|
|
credentials:
|
|
|
|
|
username: ${{ gitea.repository_owner }}
|
|
|
|
|
password: ${{ secrets.ORG_ACTIONS_TOKEN }}
|
|
|
|
|
volumes:
|
|
|
|
|
- /mnt/scons_cache:/root/.scons_cache
|
|
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
- name: Checkout Source
|
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
with:
|
|
|
|
|
submodules: recursive
|
|
|
|
|
|
|
|
|
|
- name: Download All Artifacts
|
|
|
|
|
- name: Setup Cache
|
|
|
|
|
run: |
|
|
|
|
|
export SCONS_CACHE=/root/.scons_cache
|
|
|
|
|
export SCONS_CACHE_LIMIT=5000
|
|
|
|
|
|
|
|
|
|
- name: Compile Editor
|
|
|
|
|
run: |
|
|
|
|
|
echo "Compiling Windows Editor..."
|
|
|
|
|
# production=yes handles the optimization flags automatically
|
|
|
|
|
scons platform=windows target=editor precision=double production=yes arch=x86_64 use_mingw=yes use_llvm=yes d3d12=no -j$(nproc)
|
|
|
|
|
|
|
|
|
|
- name: Compile Templates
|
|
|
|
|
run: |
|
|
|
|
|
echo "Compiling Windows Templates..."
|
|
|
|
|
scons platform=windows target=template_release precision=double production=yes arch=x86_64 use_mingw=yes use_llvm=yes d3d12=no -j$(nproc)
|
|
|
|
|
scons platform=windows target=template_debug precision=double production=yes arch=x86_64 use_mingw=yes use_llvm=yes d3d12=no -j$(nproc)
|
|
|
|
|
|
|
|
|
|
- name: Upload Artifacts
|
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
|
with:
|
|
|
|
|
name: windows-build-artifacts
|
|
|
|
|
path: bin/godot.*
|
|
|
|
|
|
|
|
|
|
# =================================================================
|
|
|
|
|
# JOB 3: PUBLISH
|
|
|
|
|
# =================================================================
|
|
|
|
|
publish:
|
|
|
|
|
name: Publish Builds
|
|
|
|
|
needs: [compile-linux, compile-windows]
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
steps:
|
|
|
|
|
- name: Download Linux
|
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
|
with:
|
|
|
|
|
path: dist
|
|
|
|
|
name: linux-build-artifacts
|
|
|
|
|
path: .
|
|
|
|
|
|
|
|
|
|
- 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 }}
|
|
|
|
|
- name: Download Windows
|
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
|
with:
|
|
|
|
|
entrypoint: /bin/sh
|
|
|
|
|
args: .gitea/workflows/scripts/publish.sh
|
|
|
|
|
name: windows-build-artifacts
|
|
|
|
|
path: bin/godot.*
|
|
|
|
|
|
|
|
|
|
# - 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
|
|
|
|
|
|
|
|
|
|
# - name: Publish Artifacts
|
|
|
|
|
# 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 }}
|
|
|
|
|
# run: |
|
|
|
|
|
# echo "Publishing artifacts..."
|
|
|
|
|
|
|
|
|
|
# apk add curl zip
|
|
|
|
|
|
|
|
|
|
# curl --fail --user "${{ACTOR}}:${{TOKEN}}" \
|
|
|
|
|
# --upload-file "godot-editor-windows.zip" \
|
|
|
|
|
# "${{API_URL}}/godot-editor-windows/${{VERSION}}/godot-editor-windows.zip"
|
|
|
|
|
|
|
|
|
|
# ... Your existing publish script logic here ...
|