2023-07-31 09:21:12 +00:00
|
|
|
name: 🌐 Web builds
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
2024-03-10 16:23:59 +00:00
|
|
|
godot-ref:
|
2023-07-31 09:21:12 +00:00
|
|
|
description: A tag, branch or commit hash in the Godot repository.
|
|
|
|
type: string
|
|
|
|
default: master
|
2024-03-10 16:23:59 +00:00
|
|
|
limboai-ref:
|
2023-07-31 09:21:12 +00:00
|
|
|
description: A tag, branch or commit hash in the LimboAI repository.
|
|
|
|
type: string
|
|
|
|
default: master
|
|
|
|
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
2024-03-10 16:23:59 +00:00
|
|
|
godot-ref:
|
2023-07-31 09:21:12 +00:00
|
|
|
description: A tag, branch or commit hash in the Godot repository.
|
|
|
|
type: string
|
|
|
|
default: master
|
2024-03-10 16:23:59 +00:00
|
|
|
limboai-ref:
|
2023-07-31 09:21:12 +00:00
|
|
|
description: A tag, branch or commit hash in the LimboAI repository.
|
|
|
|
type: string
|
|
|
|
default: master
|
|
|
|
|
|
|
|
# Global Settings
|
|
|
|
env:
|
|
|
|
SCONS_CACHE_LIMIT: 4096
|
|
|
|
# With `lto=full` VM seems to run out of ram and build fails
|
|
|
|
SCONSFLAGS: use_static_cpp=yes debug_symbols=no lto=thin optimize=size verbose=yes warnings=extra werror=yes tests=no
|
2023-11-09 13:42:19 +00:00
|
|
|
EM_VERSION: 3.1.45
|
2023-07-31 09:21:12 +00:00
|
|
|
EM_CACHE_FOLDER: "emsdk-cache"
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
web-builds:
|
|
|
|
runs-on: "ubuntu-20.04"
|
|
|
|
name: ${{ matrix.name }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- name: Template (release)
|
|
|
|
target: template_release
|
2024-07-01 11:32:02 +00:00
|
|
|
threads: true
|
2024-03-10 16:23:59 +00:00
|
|
|
dlink: false
|
2023-07-31 09:21:12 +00:00
|
|
|
|
2024-07-01 11:32:02 +00:00
|
|
|
- name: Template (release, dlink)
|
2023-07-31 09:21:12 +00:00
|
|
|
target: template_release
|
2024-07-01 11:32:02 +00:00
|
|
|
threads: true
|
2024-03-10 16:23:59 +00:00
|
|
|
dlink: true
|
2023-07-31 09:21:12 +00:00
|
|
|
|
|
|
|
- name: Template (debug)
|
|
|
|
target: template_debug
|
2024-07-01 11:32:02 +00:00
|
|
|
threads: true
|
2024-03-10 16:23:59 +00:00
|
|
|
dlink: false
|
2023-07-31 09:21:12 +00:00
|
|
|
|
2024-07-01 11:32:02 +00:00
|
|
|
- name: Template (debug, dlink)
|
2023-07-31 09:21:12 +00:00
|
|
|
target: template_debug
|
2024-07-01 11:32:02 +00:00
|
|
|
threads: true
|
|
|
|
dlink: true
|
|
|
|
|
|
|
|
- name: Template (release, nothreads)
|
|
|
|
target: template_release
|
|
|
|
threads: false
|
|
|
|
dlink: false
|
|
|
|
|
|
|
|
- name: Template (release, nothreads, dlink)
|
|
|
|
target: template_release
|
|
|
|
threads: false
|
|
|
|
dlink: true
|
|
|
|
|
|
|
|
- name: Template (debug, nothreads)
|
|
|
|
target: template_debug
|
|
|
|
threads: false
|
|
|
|
dlink: false
|
|
|
|
|
|
|
|
- name: Template (debug, nothreads, dlink)
|
|
|
|
target: template_debug
|
|
|
|
threads: false
|
2024-03-10 16:23:59 +00:00
|
|
|
dlink: true
|
2023-07-31 09:21:12 +00:00
|
|
|
|
|
|
|
env:
|
2024-03-10 16:23:59 +00:00
|
|
|
CACHE_NAME: godot.web.${{matrix.target}}${{ matrix.dlink == true && '.dlink' || '' }}
|
2023-07-31 09:21:12 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Clone Godot
|
2023-11-09 14:07:29 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-07-31 09:21:12 +00:00
|
|
|
with:
|
|
|
|
repository: godotengine/godot
|
2024-03-10 16:23:59 +00:00
|
|
|
ref: ${{ inputs.godot-ref }}
|
2023-07-31 09:21:12 +00:00
|
|
|
|
|
|
|
- name: Clone LimboAI module
|
2023-11-09 14:07:29 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-07-31 09:21:12 +00:00
|
|
|
with:
|
|
|
|
path: modules/limboai
|
2024-03-10 16:23:59 +00:00
|
|
|
ref: ${{ inputs.limboai-ref }}
|
2023-07-31 09:21:12 +00:00
|
|
|
|
2023-08-02 16:50:17 +00:00
|
|
|
# Inits GODOT_VERSION, LIMBOAI_VERSION and NAME_PREFIX environment variables.
|
|
|
|
- uses: ./modules/limboai/.github/actions/init-version
|
|
|
|
|
2024-03-10 12:12:46 +00:00
|
|
|
- name: Set up Emscripten cache
|
2024-03-10 13:24:56 +00:00
|
|
|
uses: actions/cache@v4
|
2024-03-10 12:12:46 +00:00
|
|
|
with:
|
|
|
|
path: ${{env.EM_CACHE_FOLDER}}
|
|
|
|
key: ${{env.EM_VERSION}}-${{runner.os}}-libs
|
2023-11-09 13:42:19 +00:00
|
|
|
|
|
|
|
- name: Set up Emscripten
|
2024-03-10 12:12:46 +00:00
|
|
|
uses: mymindstorm/setup-emsdk@v14
|
2023-07-31 09:21:12 +00:00
|
|
|
with:
|
|
|
|
version: ${{env.EM_VERSION}}
|
|
|
|
actions-cache-folder: ${{env.EM_CACHE_FOLDER}}
|
|
|
|
|
|
|
|
- name: Verify Emscripten setup
|
|
|
|
run: |
|
|
|
|
emcc -v
|
|
|
|
|
2023-08-01 15:31:53 +00:00
|
|
|
- name: Set up scons
|
2023-07-31 09:21:12 +00:00
|
|
|
run: |
|
|
|
|
python -c "import sys; print(sys.version)"
|
|
|
|
python -m pip install scons==4.4.0
|
|
|
|
python --version
|
|
|
|
scons --version
|
|
|
|
|
2024-12-01 14:20:13 +00:00
|
|
|
# ! Note: we stopped using the scons cache in release builds.
|
|
|
|
# - name: Set up scons cache
|
|
|
|
# uses: actions/cache@v4
|
|
|
|
# with:
|
|
|
|
# path: ${{github.workspace}}/.scons_cache/
|
|
|
|
# key: ${{env.CACHE_NAME}}-${{inputs.godot-ref}}-${{inputs.limboai-ref}}-${{env.LIMBOAI_VERSION}}
|
|
|
|
# restore-keys: |
|
|
|
|
# ${{env.CACHE_NAME}}-${{inputs.godot-ref}}-${{inputs.limboai-ref}}-${{env.LIMBOAI_VERSION}}
|
|
|
|
# ${{env.CACHE_NAME}}-${{inputs.godot-ref}}-${{inputs.limboai-ref}}
|
|
|
|
# ${{env.CACHE_NAME}}-${{inputs.godot-ref}}
|
2023-07-31 09:21:12 +00:00
|
|
|
|
|
|
|
- name: Compilation
|
|
|
|
env:
|
|
|
|
SCONS_CACHE: ${{github.workspace}}/.scons_cache/
|
|
|
|
run: |
|
2024-07-01 11:32:02 +00:00
|
|
|
scons platform=web target=${{matrix.target}} threads=${{matrix.threads}} dlink_enabled=${{matrix.dlink}} ${{env.SCONSFLAGS}}
|
2023-07-31 09:21:12 +00:00
|
|
|
|
|
|
|
- name: Prepare artifacts
|
|
|
|
run: |
|
|
|
|
mkdir -p out/templates/
|
|
|
|
mv bin/godot.web.template_debug.wasm32.zip out/templates/web_debug.zip || true
|
2024-07-01 11:32:02 +00:00
|
|
|
mv bin/godot.web.template_debug.wasm32.nothreads.zip out/templates/web_nothreads_debug.zip || true
|
2023-07-31 09:21:12 +00:00
|
|
|
mv bin/godot.web.template_debug.wasm32.dlink.zip out/templates/web_dlink_debug.zip || true
|
2024-07-01 11:32:02 +00:00
|
|
|
mv bin/godot.web.template_debug.wasm32.nothreads.dlink.zip out/templates/web_dlink_nothreads_debug.zip || true
|
|
|
|
mv bin/godot.web.template_release.wasm32.zip out/templates/web_release.zip || true
|
|
|
|
mv bin/godot.web.template_release.wasm32.nothreads.zip out/templates/web_nothreads_release.zip || true
|
|
|
|
mv bin/godot.web.template_release.wasm32.dlink.zip out/templates/web_dlink_release.zip || true
|
|
|
|
mv bin/godot.web.template_release.wasm32.nothreads.dlink.zip out/templates/web_dlink_nothreads_release.zip || true
|
2023-07-31 09:21:12 +00:00
|
|
|
rm -rf bin/
|
2023-11-29 13:32:30 +00:00
|
|
|
echo "${GODOT_VERSION}.limboai+${LIMBOAI_VERSION}" > out/templates/version.txt
|
2023-07-31 09:21:12 +00:00
|
|
|
|
|
|
|
- name: Upload artifact
|
2024-03-10 16:23:59 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2023-07-31 09:21:12 +00:00
|
|
|
with:
|
2024-07-01 11:32:02 +00:00
|
|
|
name: ${{env.NAME_PREFIX}}.${{matrix.target}}.web${{matrix.threads == false && '.nothreads' || ''}}${{matrix.dlink == true && '.dlink' || ''}}
|
2023-08-01 15:31:53 +00:00
|
|
|
path: out/*
|