Skip to content

Commit 914eae7

Browse files
committed
Add web build
1 parent 20eaa00 commit 914eae7

File tree

2 files changed

+25
-16
lines changed

2 files changed

+25
-16
lines changed

.github/workflows/build.yml

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,17 @@ jobs:
1818
build:
1919
runs-on: ${{ matrix.runner }}
2020
name: ${{ matrix.platform }} ${{ matrix.target }} ${{ matrix.arch }} ${{ matrix.optimize }}
21+
2122
env:
2223
BUILD_ID: ${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.arch }}-${{ matrix.optimize }}
24+
EM_VERSION: 4.0.9
25+
EM_CACHE_FOLDER: "emsdk-cache"
26+
2327
strategy:
2428
fail-fast: false
2529
matrix:
2630
target: [ template_debug, template_release ]
27-
identifier: [ windows, linux, macos, android, android_arm64 ]
31+
identifier: [ windows, linux, macos, android, android_arm64, web ]
2832

2933
include:
3034
# Defaults
@@ -55,6 +59,10 @@ jobs:
5559
platform: android
5660
arch: arm64
5761

62+
- identifier: web
63+
platform: web
64+
arch: wasm32
65+
5866
steps:
5967
- name: Check settings
6068
if: ${{ matrix.platform == '' || matrix.target == '' || matrix.runner == '' || matrix.optimize == '' || matrix.arch == ''}}
@@ -95,6 +103,20 @@ jobs:
95103
ndk-version: r23c
96104
link-to-sdk: true
97105

106+
- name: (Web) Set up Emscripten cache
107+
if: ${{ matrix.platform == 'web' }}
108+
uses: actions/cache@v4
109+
with:
110+
path: ${{env.EM_CACHE_FOLDER}}
111+
key: ${{env.EM_VERSION}}-${{ env.BUILD_ID }}
112+
113+
- name: (Web) Set up Emscripten
114+
if: ${{ matrix.platform == 'web' }}
115+
uses: mymindstorm/setup-emsdk@v14
116+
with:
117+
version: ${{env.EM_VERSION}}
118+
actions-cache-folder: ${{env.EM_CACHE_FOLDER}}
119+
98120
- name: Set up Python
99121
uses: actions/setup-python@v5
100122
with:
@@ -113,21 +135,6 @@ jobs:
113135
submodules: recursive
114136
ref: ${{ inputs.git-ref }}
115137

116-
# TODO: Cache doesn't work yet. SCons rebuilds the objects even if they already exist. Could be caused by modification dates or extension_api.json.
117-
# fetch-depth: 0 May be needed for cache. See: <https://github.com/actions/checkout/issues/468>.
118-
# - name: Set up SCons cache
119-
# uses: actions/cache@v3
120-
# with:
121-
# path: |
122-
# ${{ github.workspace }}/.scons-cache/
123-
# ${{ github.workspace }}/**/.sconsign.dblite
124-
# ${{ github.workspace }}/godot-cpp/gen/
125-
# key: ${{ matrix.platform }}-${{ github.ref }}-${{ github.sha }}
126-
# restore-keys: |
127-
# ${{ matrix.platform }}-${{ github.ref }}-${{ github.sha }}
128-
# ${{ matrix.platform }}-${{ github.ref }}
129-
# ${{ matrix.platform }}
130-
131138
- name: Scons Cache
132139
id: scons-cache
133140
uses: actions/cache@v4

demo/addons/ropesim/libropesim.gdextension

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ android.debug.x86_64 = "res://addons/ropesim/bin/libropesim.android.template_deb
1515
android.release.x86_64 = "res://addons/ropesim/bin/libropesim.android.template_release.x86_64.so"
1616
android.debug.arm64 = "res://addons/ropesim/bin/libropesim.android.template_debug.arm64.so"
1717
android.release.arm64 = "res://addons/ropesim/bin/libropesim.android.template_release.arm64.so"
18+
web.debug.wasm32 = "res://addons/ropesim/bin/libropesim.web.template_debug.wasm32.wasm"
19+
web.release.wasm32 = "res://addons/ropesim/bin/libropesim.web.template_release.wasm32.wasm"

0 commit comments

Comments
 (0)