140 lines
4.4 KiB
YAML
140 lines
4.4 KiB
YAML
name: 🐧 Linux GDExtension builds
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
godot-cpp-version:
|
|
description: Ref in the godot-cpp repository.
|
|
type: string
|
|
default: 4.2
|
|
limboai-treeish:
|
|
description: A tag, branch or commit hash in the LimboAI repository.
|
|
type: string
|
|
default: master
|
|
# test-build:
|
|
# description: Should we perform only a limited number of test builds?
|
|
# type: boolean
|
|
# default: false
|
|
|
|
workflow_dispatch:
|
|
inputs:
|
|
godot-cpp-version:
|
|
description: Ref in the godot-cpp repository.
|
|
type: string
|
|
default: 4.2
|
|
limboai-treeish:
|
|
description: A tag, branch or commit hash in the LimboAI repository.
|
|
type: string
|
|
default: master
|
|
# test-build:
|
|
# description: Should we perform only a limited number of test builds?
|
|
# type: boolean
|
|
# default: false
|
|
|
|
# Global Settings
|
|
env:
|
|
SCONS_CACHE_LIMIT: 4096
|
|
SCONSFLAGS: dev_build=no debug_symbols=no symbol_visibility=auto
|
|
|
|
jobs:
|
|
gdextension-linux:
|
|
runs-on: "ubuntu-20.04"
|
|
name: ${{ matrix.opts.name }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
opts:
|
|
- name: GDExtension (x86_64, release)
|
|
target: template_release
|
|
arch: x86_64
|
|
should-build: true
|
|
|
|
- name: GDExtension (x86_64, debug)
|
|
target: editor
|
|
arch: x86_64
|
|
should-build: true
|
|
|
|
exclude:
|
|
- { opts: {should-build: false }}
|
|
|
|
env:
|
|
BIN: liblimboai.linux.${{matrix.opts.target}}.${{matrix.opts.arch}}
|
|
|
|
steps:
|
|
- name: Clone godot-cpp
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: godotengine/godot-cpp
|
|
path: godot-cpp
|
|
ref: ${{ inputs.godot-cpp-version }}
|
|
|
|
- name: Clone LimboAI module
|
|
uses: actions/checkout@v4
|
|
with:
|
|
path: limboai
|
|
ref: ${{ inputs.limboai-treeish }}
|
|
|
|
# Inits GODOT_VERSION, LIMBOAI_VERSION and NAME_PREFIX environment variables.
|
|
- uses: ./limboai/.github/actions/init-version
|
|
|
|
# About sed see: https://github.com/godotengine/buildroot/issues/6
|
|
- name: Set up buildroot x86_64
|
|
if: matrix.opts.arch == 'x86_64'
|
|
run: |
|
|
wget https://download.tuxfamily.org/godotengine/toolchains/linux/x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
|
|
tar -xjf x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
|
|
mv x86_64-godot-linux-gnu_sdk-buildroot buildroot
|
|
cd buildroot
|
|
sed -i x86_64-godot-linux-gnu/sysroot/usr/lib/pkgconfig/dbus-1.pc -e "s@/lib@/lib64@g"
|
|
./relocate-sdk.sh
|
|
cd ..
|
|
|
|
- name: Set up buildroot x86_32
|
|
if: matrix.opts.arch == 'x86_32'
|
|
run: |
|
|
wget https://download.tuxfamily.org/godotengine/toolchains/linux/i686-godot-linux-gnu_sdk-buildroot.tar.bz2
|
|
tar -xjf i686-godot-linux-gnu_sdk-buildroot.tar.bz2
|
|
mv i686-godot-linux-gnu_sdk-buildroot buildroot
|
|
cd buildroot
|
|
./relocate-sdk.sh
|
|
cd ..
|
|
|
|
- name: Set up scons cache
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: ${{github.workspace}}/.scons_cache/
|
|
key: ${{env.BIN}}-${{inputs.godot-cpp-version}}-${{inputs.limboai-treeish}}-${{env.LIMBOAI_VERSION}}
|
|
restore-keys: |
|
|
${{env.BIN}}-${{inputs.godot-cpp-version}}-${{inputs.limboai-treeish}}-${{env.LIMBOAI_VERSION}}
|
|
${{env.BIN}}-${{inputs.godot-cpp-version}}-${{inputs.limboai-treeish}}
|
|
${{env.BIN}}-${{inputs.godot-cpp-version}}
|
|
|
|
- name: Setup project structure for GDExtension
|
|
shell: bash
|
|
run: |
|
|
bash ./limboai/gdextension/setup_gdextension.sh
|
|
ls
|
|
ls -R demo/
|
|
|
|
- name: Compilation
|
|
env:
|
|
SCONS_CACHE: ${{github.workspace}}/.scons_cache/
|
|
run: |
|
|
PATH=${GITHUB_WORKSPACE}/buildroot/bin:$PATH
|
|
scons platform=linux target=${{matrix.opts.target}} arch=${{matrix.opts.arch}} ${{env.SCONSFLAGS}}
|
|
|
|
- name: Prepare artifact
|
|
run: |
|
|
mkdir -p out/
|
|
cp -r --dereference demo/addons/ out/
|
|
strip out/addons/limboai/bin/liblimboai*
|
|
chmod +x out/addons/limboai/bin/liblimboai*
|
|
ls -R out/
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v3
|
|
env:
|
|
NAME: ${{env.NAME_PREFIX}}.gdextension
|
|
with:
|
|
name: ${{ env.NAME }}
|
|
path: out/*
|