2024-01-11 19:16:00 +00:00
|
|
|
name: 🔌 GDExtension
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
2024-03-10 16:23:59 +00:00
|
|
|
godot-cpp-ref:
|
2024-01-11 19:16:00 +00:00
|
|
|
description: A tag, branch or commit hash in the godot-cpp repository.
|
|
|
|
type: string
|
2024-08-15 14:30:42 +00:00
|
|
|
default: godot-4.3-stable
|
2024-03-10 16:23:59 +00:00
|
|
|
limboai-ref:
|
2024-01-11 19:16:00 +00:00
|
|
|
description: A tag, branch or commit hash in the LimboAI repository.
|
|
|
|
type: string
|
|
|
|
default: master
|
|
|
|
test-build:
|
2024-09-09 08:48:48 +00:00
|
|
|
description: Limit the number of test builds
|
|
|
|
type: boolean
|
|
|
|
default: false
|
|
|
|
debug-symbols:
|
|
|
|
description: Build with debug symbols
|
2024-01-11 19:16:00 +00:00
|
|
|
type: boolean
|
|
|
|
default: false
|
|
|
|
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
2024-03-10 16:23:59 +00:00
|
|
|
godot-cpp-ref:
|
2024-01-11 19:16:00 +00:00
|
|
|
description: A tag, branch or commit hash in the godot-cpp repository.
|
|
|
|
type: string
|
2024-08-15 14:30:42 +00:00
|
|
|
default: godot-4.3-stable
|
2024-03-10 16:23:59 +00:00
|
|
|
limboai-ref:
|
2024-01-11 19:16:00 +00:00
|
|
|
description: A tag, branch or commit hash in the LimboAI repository.
|
|
|
|
type: string
|
|
|
|
default: master
|
|
|
|
test-build:
|
2024-09-09 08:48:48 +00:00
|
|
|
description: Limit the number of test builds
|
|
|
|
type: boolean
|
|
|
|
default: false
|
|
|
|
debug-symbols:
|
|
|
|
description: Build with debug symbols
|
2024-01-11 19:16:00 +00:00
|
|
|
type: boolean
|
|
|
|
default: false
|
|
|
|
|
|
|
|
# Global Settings
|
|
|
|
env:
|
|
|
|
SCONS_CACHE_LIMIT: 4096
|
2024-09-09 08:48:48 +00:00
|
|
|
SCONSFLAGS: use_mingw=yes dev_build=no
|
2024-02-14 20:12:39 +00:00
|
|
|
EM_VERSION: 3.1.45
|
|
|
|
EM_CACHE_FOLDER: "emsdk-cache"
|
2024-08-15 14:30:42 +00:00
|
|
|
GODOT_VERSION: 4.3-stable
|
2024-01-11 19:16:00 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
gdextension:
|
|
|
|
runs-on: ${{ matrix.opts.runner }}
|
|
|
|
name: ${{ matrix.opts.name }}
|
2024-03-10 16:23:59 +00:00
|
|
|
outputs:
|
|
|
|
name-prefix: ${{ steps.output-name-prefix.outputs.name-prefix }}
|
2024-01-11 19:16:00 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
opts:
|
|
|
|
- name: 🐧 Linux (x86_64, release)
|
|
|
|
runner: ubuntu-20.04
|
|
|
|
platform: linux
|
|
|
|
target: template_release
|
|
|
|
arch: x86_64
|
|
|
|
should-build: true
|
|
|
|
|
|
|
|
- name: 🐧 Linux (x86_64, debug)
|
|
|
|
runner: ubuntu-20.04
|
|
|
|
platform: linux
|
|
|
|
target: editor
|
|
|
|
arch: x86_64
|
|
|
|
should-build: true
|
|
|
|
|
|
|
|
- name: 🪟 Windows (x86_64, release)
|
|
|
|
runner: windows-latest
|
|
|
|
platform: windows
|
|
|
|
target: template_release
|
|
|
|
arch: x86_64
|
|
|
|
should-build: true
|
|
|
|
|
|
|
|
- name: 🪟 Windows (x86_64, debug)
|
|
|
|
runner: windows-latest
|
|
|
|
platform: windows
|
|
|
|
target: editor
|
|
|
|
arch: x86_64
|
|
|
|
should-build: true
|
|
|
|
|
|
|
|
- name: 🍎 macOS (universal, release)
|
|
|
|
runner: macos-latest
|
|
|
|
platform: macos
|
|
|
|
target: template_release
|
|
|
|
arch: universal
|
|
|
|
should-build: true
|
|
|
|
|
|
|
|
- name: 🍎 macOS (universal, debug)
|
|
|
|
runner: macos-latest
|
|
|
|
platform: macos
|
|
|
|
target: editor
|
|
|
|
arch: universal
|
|
|
|
should-build: true
|
|
|
|
|
2024-02-14 19:33:52 +00:00
|
|
|
- name: 🌐 Web (wasm32, release)
|
|
|
|
runner: ubuntu-20.04
|
|
|
|
platform: web
|
|
|
|
target: template_release
|
|
|
|
arch: wasm32
|
2024-06-20 17:54:14 +00:00
|
|
|
should-build: ${{ !inputs.test-build }}
|
2024-02-14 19:33:52 +00:00
|
|
|
|
2024-02-18 21:55:42 +00:00
|
|
|
- name: 🌐 Web (wasm32, debug)
|
|
|
|
runner: ubuntu-20.04
|
|
|
|
platform: web
|
|
|
|
target: template_debug
|
|
|
|
arch: wasm32
|
2024-06-20 17:54:14 +00:00
|
|
|
should-build: ${{ !inputs.test-build }}
|
2024-02-18 21:55:42 +00:00
|
|
|
|
2024-06-20 17:20:53 +00:00
|
|
|
- name: 🤖 Android (arm64, release)
|
|
|
|
runner: ubuntu-20.04
|
|
|
|
platform: android
|
|
|
|
target: template_release
|
|
|
|
arch: arm64
|
2024-06-20 17:54:14 +00:00
|
|
|
should-build: ${{ !inputs.test-build }}
|
2024-06-20 17:20:53 +00:00
|
|
|
|
|
|
|
- name: 🤖 Android (arm64, debug)
|
|
|
|
runner: ubuntu-20.04
|
|
|
|
platform: android
|
|
|
|
target: template_debug
|
|
|
|
arch: arm64
|
2024-06-20 17:54:14 +00:00
|
|
|
should-build: ${{ !inputs.test-build }}
|
2024-06-20 17:20:53 +00:00
|
|
|
|
2024-06-21 08:18:15 +00:00
|
|
|
- name: 🤖 Android (arm32, release)
|
|
|
|
runner: ubuntu-20.04
|
|
|
|
platform: android
|
|
|
|
target: template_release
|
|
|
|
arch: arm32
|
|
|
|
should-build: ${{ !inputs.test-build }}
|
|
|
|
|
|
|
|
- name: 🤖 Android (arm32, debug)
|
|
|
|
runner: ubuntu-20.04
|
|
|
|
platform: android
|
|
|
|
target: template_debug
|
|
|
|
arch: arm32
|
|
|
|
should-build: ${{ !inputs.test-build }}
|
|
|
|
|
2024-06-20 17:20:53 +00:00
|
|
|
- name: 🤖 Android (x86_64, release)
|
|
|
|
runner: ubuntu-20.04
|
|
|
|
platform: android
|
|
|
|
target: template_release
|
|
|
|
arch: x86_64
|
2024-06-20 17:54:14 +00:00
|
|
|
should-build: ${{ !inputs.test-build }}
|
2024-06-20 17:20:53 +00:00
|
|
|
|
|
|
|
- name: 🤖 Android (x86_64, debug)
|
|
|
|
runner: ubuntu-20.04
|
|
|
|
platform: android
|
|
|
|
target: template_debug
|
|
|
|
arch: x86_64
|
2024-06-20 17:54:14 +00:00
|
|
|
should-build: ${{ !inputs.test-build }}
|
2024-06-20 17:20:53 +00:00
|
|
|
|
2024-06-21 08:18:15 +00:00
|
|
|
- name: 🤖 Android (x86_32, release)
|
|
|
|
runner: ubuntu-20.04
|
|
|
|
platform: android
|
|
|
|
target: template_release
|
|
|
|
arch: x86_32
|
|
|
|
should-build: ${{ !inputs.test-build }}
|
|
|
|
|
|
|
|
- name: 🤖 Android (x86_32, debug)
|
|
|
|
runner: ubuntu-20.04
|
|
|
|
platform: android
|
|
|
|
target: template_debug
|
|
|
|
arch: x86_32
|
|
|
|
should-build: ${{ !inputs.test-build }}
|
|
|
|
|
2024-01-11 19:16:00 +00:00
|
|
|
exclude:
|
2024-02-14 19:33:52 +00:00
|
|
|
- { opts: { should-build: false } }
|
2024-01-11 19:16:00 +00:00
|
|
|
|
|
|
|
env:
|
|
|
|
BIN: liblimboai.${{matrix.opts.platform}}.${{matrix.opts.target}}.${{matrix.opts.arch}}
|
|
|
|
|
|
|
|
steps:
|
2024-08-07 13:24:04 +00:00
|
|
|
- name: Clone LimboAI module
|
2024-01-11 19:16:00 +00:00
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
fetch-tags: true
|
2024-08-07 13:24:04 +00:00
|
|
|
ref: ${{ inputs.limboai-ref }}
|
2024-01-11 19:16:00 +00:00
|
|
|
|
2024-08-07 13:24:04 +00:00
|
|
|
- name: Clone godot-cpp
|
2024-01-11 19:16:00 +00:00
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
2024-08-07 13:24:04 +00:00
|
|
|
repository: godotengine/godot-cpp
|
2024-01-11 19:16:00 +00:00
|
|
|
fetch-tags: true
|
2024-08-07 13:24:04 +00:00
|
|
|
path: godot-cpp
|
|
|
|
ref: ${{ inputs.godot-cpp-ref }}
|
2024-01-11 19:16:00 +00:00
|
|
|
|
|
|
|
# Inits GDEXTENSION_VERSION, LIMBOAI_VERSION and NAME_PREFIX environment variables.
|
2024-08-07 13:24:04 +00:00
|
|
|
- uses: ./.github/actions/init-version-gdext
|
2024-01-11 19:16:00 +00:00
|
|
|
|
2024-03-10 16:23:59 +00:00
|
|
|
- name: Output NAME_PREFIX
|
|
|
|
id: output-name-prefix
|
|
|
|
run: echo "name-prefix=${NAME_PREFIX}" >> $GITHUB_OUTPUT
|
|
|
|
|
2024-05-25 08:16:40 +00:00
|
|
|
- name: Setup Linux toolchain
|
|
|
|
if: matrix.opts.platform == 'linux'
|
2024-08-07 13:24:04 +00:00
|
|
|
uses: ./.github/actions/setup-linux-toolchain
|
2024-05-25 08:16:40 +00:00
|
|
|
with:
|
|
|
|
arch: ${{matrix.opts.arch}}
|
2024-01-11 19:16:00 +00:00
|
|
|
|
|
|
|
- name: Set up Python 3.x
|
|
|
|
if: matrix.opts.platform == 'windows' || matrix.opts.platform == 'macos'
|
2024-03-10 13:24:56 +00:00
|
|
|
uses: actions/setup-python@v5
|
2024-01-11 19:16:00 +00:00
|
|
|
with:
|
2024-02-14 19:33:52 +00:00
|
|
|
python-version: "3.x"
|
|
|
|
architecture: "x64"
|
2024-01-11 19:16:00 +00:00
|
|
|
|
2024-02-14 20:12:39 +00:00
|
|
|
- name: Set up Emscripten cache
|
|
|
|
if: matrix.opts.platform == 'web'
|
2024-03-10 13:24:56 +00:00
|
|
|
uses: actions/cache@v4
|
2024-02-14 20:12:39 +00:00
|
|
|
with:
|
|
|
|
path: ${{env.EM_CACHE_FOLDER}}
|
|
|
|
key: ${{env.EM_VERSION}}-${{runner.os}}-libs
|
|
|
|
|
|
|
|
- name: Set up Emscripten
|
|
|
|
if: matrix.opts.platform == 'web'
|
2024-03-10 12:12:46 +00:00
|
|
|
uses: mymindstorm/setup-emsdk@v14
|
2024-02-14 20:12:39 +00:00
|
|
|
with:
|
|
|
|
version: ${{env.EM_VERSION}}
|
|
|
|
actions-cache-folder: ${{env.EM_CACHE_FOLDER}}
|
|
|
|
|
|
|
|
- name: Verify Emscripten setup
|
|
|
|
if: matrix.opts.platform == 'web'
|
|
|
|
run: |
|
|
|
|
emcc -v
|
|
|
|
|
2024-01-11 19:16:00 +00:00
|
|
|
- name: Set up scons
|
2024-06-20 17:20:53 +00:00
|
|
|
if: matrix.opts.platform != 'linux'
|
2024-01-11 19:16:00 +00:00
|
|
|
run: |
|
|
|
|
python -c "import sys; print(sys.version)"
|
|
|
|
python -m pip install scons==4.4.0
|
|
|
|
python --version
|
|
|
|
scons --version
|
|
|
|
|
2024-06-20 17:20:53 +00:00
|
|
|
- name: Set up Java 17
|
|
|
|
if: matrix.opts.platform == 'android'
|
|
|
|
uses: actions/setup-java@v4
|
|
|
|
with:
|
|
|
|
distribution: temurin
|
|
|
|
java-version: 17
|
|
|
|
|
|
|
|
- uses: nttld/setup-ndk@v1
|
|
|
|
if: matrix.opts.platform == 'android'
|
|
|
|
id: setup-ndk
|
|
|
|
with:
|
|
|
|
ndk-version: r23c
|
|
|
|
link-to-sdk: true
|
|
|
|
|
2024-01-11 19:16:00 +00:00
|
|
|
- name: Set up MSVC problem matcher on Windows
|
|
|
|
if: matrix.opts.platform == 'windows'
|
|
|
|
uses: ammaraskar/msvc-problem-matcher@master
|
|
|
|
|
|
|
|
- name: Set up scons cache
|
2024-03-10 13:24:56 +00:00
|
|
|
uses: actions/cache@v4
|
2024-01-11 19:16:00 +00:00
|
|
|
with:
|
|
|
|
path: ${{github.workspace}}/.scons_cache/
|
2024-09-09 08:48:48 +00:00
|
|
|
key: ${{env.BIN}}-${{inputs.debug-symbols}}-${{inputs.godot-cpp-ref}}-${{inputs.limboai-ref}}-${{env.LIMBOAI_VERSION}}
|
2024-01-11 19:16:00 +00:00
|
|
|
restore-keys: |
|
2024-09-09 08:48:48 +00:00
|
|
|
${{env.BIN}}-${{inputs.debug-symbols}}-${{inputs.godot-cpp-ref}}-${{inputs.limboai-ref}}-${{env.LIMBOAI_VERSION}}
|
|
|
|
${{env.BIN}}-${{inputs.debug-symbols}}-${{inputs.godot-cpp-ref}}-${{inputs.limboai-ref}}
|
|
|
|
${{env.BIN}}-${{inputs.debug-symbols}}-${{inputs.godot-cpp-ref}}
|
2024-01-11 19:16:00 +00:00
|
|
|
|
|
|
|
- name: Compilation
|
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
SCONS_CACHE: ${{github.workspace}}/.scons_cache/
|
2024-09-09 08:48:48 +00:00
|
|
|
DEBUG_FLAGS: ${{ inputs.debug-symbols && 'debug_symbols=yes symbols_visibility=visible' || 'debug_symbols=no' }}
|
2024-01-11 19:16:00 +00:00
|
|
|
run: |
|
|
|
|
PATH=${GITHUB_WORKSPACE}/buildroot/bin:$PATH
|
2024-09-09 08:48:48 +00:00
|
|
|
scons platform=${{matrix.opts.platform}} target=${{matrix.opts.target}} arch=${{matrix.opts.arch}} ${{env.DEBUG_FLAGS}} ${{env.SCONSFLAGS}}
|
2024-01-11 19:16:00 +00:00
|
|
|
|
|
|
|
- name: Prepare artifact
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2024-09-09 08:48:48 +00:00
|
|
|
ls -R demo/addons/limboai/
|
2024-01-11 19:16:00 +00:00
|
|
|
mkdir out
|
|
|
|
mv demo/addons/ out/
|
2024-08-07 13:24:04 +00:00
|
|
|
cp {README,LICENSE,LOGO_LICENSE}.md out/addons/limboai/
|
|
|
|
cp -R demo/demo/ out/demo/
|
|
|
|
cp demo/LICENSE_ASSETS.md out/demo/
|
2024-01-11 19:16:00 +00:00
|
|
|
rm -f out/addons/limboai/bin/*.{exp,lib,pdb}
|
2024-04-07 12:11:39 +00:00
|
|
|
echo "${LIMBOAI_VERSION}" > out/addons/limboai/version.txt
|
2024-01-17 16:54:20 +00:00
|
|
|
echo "---"
|
2024-01-11 19:16:00 +00:00
|
|
|
ls -R out/
|
|
|
|
|
|
|
|
- name: Upload artifact
|
2024-03-10 16:23:59 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2024-01-11 19:16:00 +00:00
|
|
|
env:
|
2024-03-10 16:23:59 +00:00
|
|
|
NAME: tmp-gdextension.${{matrix.opts.platform}}.${{matrix.opts.target}}.${{matrix.opts.arch}}
|
2024-01-11 19:16:00 +00:00
|
|
|
with:
|
|
|
|
name: ${{ env.NAME }}
|
|
|
|
path: out/*
|
2024-03-10 16:23:59 +00:00
|
|
|
|
2024-05-22 20:13:29 +00:00
|
|
|
package-extension:
|
|
|
|
name: 📦 Package extension
|
2024-03-10 16:23:59 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: gdextension
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Merge artifacts
|
|
|
|
uses: actions/upload-artifact/merge@v4
|
|
|
|
with:
|
|
|
|
name: ${{needs.gdextension.outputs.name-prefix}}
|
|
|
|
pattern: tmp-gdextension.*
|
|
|
|
delete-merged: true
|
2024-05-22 20:13:29 +00:00
|
|
|
|
|
|
|
- name: Download artifact
|
|
|
|
uses: actions/download-artifact@v4
|
|
|
|
with:
|
|
|
|
name: ${{needs.gdextension.outputs.name-prefix}}
|
|
|
|
path: out/
|
|
|
|
|
|
|
|
- name: Setup Godot
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
echo "Downloading Godot ${GODOT_VERSION}"
|
|
|
|
mkdir bin
|
|
|
|
cd bin
|
|
|
|
wget "https://github.com/godotengine/godot/releases/download/${GODOT_VERSION}/Godot_v${GODOT_VERSION}_linux.x86_64.zip" -O godot.zip
|
|
|
|
unzip godot.zip
|
|
|
|
rm godot.zip
|
|
|
|
mv Godot_* godot
|
|
|
|
chmod u+x godot
|
|
|
|
ls -l
|
2024-05-25 08:16:40 +00:00
|
|
|
cd ..
|
2024-05-22 20:13:29 +00:00
|
|
|
./bin/godot --version
|
|
|
|
|
|
|
|
- name: Generate icon .import files
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2024-05-25 08:16:40 +00:00
|
|
|
touch out/project.godot
|
2024-05-22 20:13:29 +00:00
|
|
|
timeout 20s ./bin/godot --headless --editor --path ./out/ || /bin/true
|
2024-05-25 08:16:40 +00:00
|
|
|
rm out/project.godot
|
|
|
|
rm -rf out/.godot/
|
2024-05-22 20:13:29 +00:00
|
|
|
|
2024-06-15 06:42:41 +00:00
|
|
|
- name: Change editor icon import settings
|
2024-05-22 20:13:29 +00:00
|
|
|
shell: bash
|
|
|
|
run: |
|
2024-05-25 08:16:40 +00:00
|
|
|
echo "--- Listing icons dir:"
|
|
|
|
ls out/addons/limboai/icons/
|
2024-05-22 20:13:29 +00:00
|
|
|
echo "--- (end of listing)"
|
|
|
|
sed -i 's|editor/scale_with_editor_scale=false|editor/scale_with_editor_scale=true|' out/addons/limboai/icons/*.import
|
2024-06-15 06:42:41 +00:00
|
|
|
sed -i 's|editor/convert_colors_with_editor_theme=false|editor/convert_colors_with_editor_theme=true|' out/addons/limboai/icons/*.import
|
2024-05-22 20:13:29 +00:00
|
|
|
|
|
|
|
- name: Upload artifact
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: ${{needs.gdextension.outputs.name-prefix}}
|
|
|
|
path: out/*
|
|
|
|
overwrite: true
|