Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add wasm gdextension builds #179

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/gdextension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,21 @@ jobs:
platform: ios
arch: universal
should-build: ${{ inputs.fullbuild }}

- identifier: web-release (wasm32)
name: Javascript (wasm32) - template_release
runner: ubuntu-20.04
target: template_release
platform: javascript
arch: wasm32
should-build: ${{ inputs.fullbuild }}
- identifier: web-debug (universal)
name: Javascript (wasm32) - template_debug
runner: ubuntu-20.04
target: template_debug
platform: javascript
arch: wasm32
should-build: true
exclude:
- {opts: {should-build: false}}

Expand Down Expand Up @@ -217,6 +232,12 @@ jobs:
cd buildroot
./relocate-sdk.sh

- name: (Web) Install emscripten
if: matrix.opts.platform == 'javascript'
uses: mymindstorm/setup-emsdk@v12
with:
version: 3.1.45

- name: Set up Python
uses: actions/setup-python@v2

Expand All @@ -236,16 +257,27 @@ jobs:
${{github.job}}-${{env.BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
${{github.job}}-${{env.BASE_BRANCH}}-${{github.ref}}
${{github.job}}-${{env.BASE_BRANCH}}-${{env.BASE_BRANCH}}

- name: Compile extension
if: matrix.opts.platform != 'javascript'
shell: sh
run: |
PATH=/opt/buildroot/bin:$PATH scons target='${{ matrix.opts.target }}' platform='${{ matrix.opts.platform }}' arch='${{ matrix.opts.arch }}' ${{ matrix.opts.args }}
ls -l project/addons/luaAPI/bin/

- name: Compile extension (Web)
if: matrix.opts.platform == 'javascript'
shell: sh
run: |
scons target='${{ matrix.opts.target }}' platform='${{ matrix.opts.platform }}' arch='${{ matrix.opts.arch }}' ${{ matrix.opts.args }}
ls -l project/addons/luaAPI/bin/

- name: Strip bins
if: "!startsWith(matrix.opts.identifier, 'windows-') && startsWith(matrix.opts.arch, 'x86_')"
shell: sh
run: |
strip project/addons/luaAPI/bin/*

- name: Prepare artifact
shell: sh
env:
Expand Down
3 changes: 3 additions & 0 deletions project/addons/luaAPI/luaAPI.gdextension
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ ios.debug.arm64 = "bin/libluaapi.ios.template_debug.arm64.dylib"
ios.release.arm64 = "bin/libluaapi.ios.template_release.arm64.dylib"
ios.debug.simulator = "bin/libluaapi.ios.template_debug.universal.simulator.dylib"
ios.release.simulator = "bin/libluaapi.ios.template_release.universal.simulator.dylib"

web.debug.wasm32 = "res://bin/libluaapi.javascript.template_debug.wasm32.wasm"
web.release.wasm32 = "res://bin/libluaapi.javascript.template_release.wasm32.wasm"
Loading