| 1 |
name: 🌐 Web Builds |
| 2 |
on: |
| 3 |
workflow_call: |
| 4 |
workflow_dispatch: |
| 5 |
|
| 6 |
|
| 7 |
env: |
| 8 |
SCONS_FLAGS: >- |
| 9 |
dev_mode=yes |
| 10 |
tests=no |
| 11 |
debug_symbols=no |
| 12 |
use_closure_compiler=yes |
| 13 |
EM_VERSION: 4.0.11 |
| 14 |
|
| 15 |
jobs: |
| 16 |
web-template: |
| 17 |
runs-on: ubuntu-24.04 |
| 18 |
name: ${{ matrix.name }} |
| 19 |
timeout-minutes: 60 |
| 20 |
strategy: |
| 21 |
fail-fast: false |
| 22 |
matrix: |
| 23 |
include: |
| 24 |
- name: Template w/ threads (target=template_release, threads=yes) |
| 25 |
cache-name: web-template |
| 26 |
target: template_release |
| 27 |
scons-flags: threads=yes |
| 28 |
artifact: true |
| 29 |
|
| 30 |
- name: Template w/o threads (target=template_release, threads=no) |
| 31 |
cache-name: web-nothreads-template |
| 32 |
target: template_release |
| 33 |
scons-flags: threads=no |
| 34 |
artifact: true |
| 35 |
|
| 36 |
steps: |
| 37 |
- name: Checkout |
| 38 |
uses: actions/checkout@v6 |
| 39 |
with: |
| 40 |
submodules: recursive |
| 41 |
|
| 42 |
- name: Set up Emscripten latest |
| 43 |
uses: emscripten-core/setup-emsdk@v16 |
| 44 |
with: |
| 45 |
version: ${{ env.EM_VERSION }} |
| 46 |
no-cache: true |
| 47 |
|
| 48 |
- name: Verify Emscripten setup |
| 49 |
run: | |
| 50 |
emcc -v |
| 51 |
|
| 52 |
- name: Restore Godot build cache |
| 53 |
uses: ./.github/actions/godot-cache-restore |
| 54 |
with: |
| 55 |
cache-name: ${{ matrix.cache-name }} |
| 56 |
continue-on-error: true |
| 57 |
|
| 58 |
- name: Setup Python and SCons |
| 59 |
uses: ./.github/actions/godot-deps |
| 60 |
|
| 61 |
- name: Compilation |
| 62 |
uses: ./.github/actions/godot-build |
| 63 |
with: |
| 64 |
scons-flags: ${{ env.SCONS_FLAGS }} ${{ matrix.scons-flags }} |
| 65 |
platform: web |
| 66 |
target: ${{ matrix.target }} |
| 67 |
|
| 68 |
- name: Save Godot build cache |
| 69 |
uses: ./.github/actions/godot-cache-save |
| 70 |
with: |
| 71 |
cache-name: ${{ matrix.cache-name }} |
| 72 |
continue-on-error: true |
| 73 |
|
| 74 |
- name: Upload artifact |
| 75 |
uses: ./.github/actions/upload-artifact |
| 76 |
if: matrix.artifact |
| 77 |
with: |
| 78 |
name: ${{ matrix.cache-name }} |