diff --git a/.github/workflows/gdextension.yml b/.github/workflows/gdextension.yml index f87e3410..127fa42b 100644 --- a/.github/workflows/gdextension.yml +++ b/.github/workflows/gdextension.yml @@ -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}} @@ -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 @@ -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: diff --git a/project/addons/luaAPI/luaAPI.gdextension b/project/addons/luaAPI/luaAPI.gdextension index af4c6801..4d7f9570 100644 --- a/project/addons/luaAPI/luaAPI.gdextension +++ b/project/addons/luaAPI/luaAPI.gdextension @@ -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" \ No newline at end of file