diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 98986a7..d1effca 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -173,16 +173,20 @@ jobs: addons/godot_xterm/native/bin/*.xcframework addons/godot_xterm/native/bin/*.dll - html5-export: - name: "HTML5 Export" - needs: [check-archive, check-pre-commit] + web-export: + name: "Web Export" runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 + - id: install-chrome + uses: browser-actions/setup-chrome@v1 + with: + chrome-version: 121 - name: Setup Godot uses: lihop/setup-godot@v2 with: version: "4.2.1-stable" + export-templates: true - name: Import assets run: godot --editor --headless --quit-after 100 || true - name: Wait for build @@ -196,41 +200,28 @@ jobs: with: path: addons/godot_xterm/native/bin merge-multiple: true - # Some remaining steps temporarily disabled. - - name: Export HTML5 - if: false + - name: Export for web uses: nick-fields/retry@v3 with: - command: godot --no-window --export HTML5 + command: godot --no-window --export-release Web retry_on: error timeout_minutes: 5 max_attempts: 6 - name: NPM cache uses: c-hive/gha-npm-cache@v1 with: - directory: test/html5 - - name: Smoke test HTML5 export - if: false + directory: test/web + - name: Smoke test Web export shell: bash - working-directory: test/html5 + working-directory: test/web run: | + export GODOT_XTERM_CHROME_PATH=${{ steps.install-chrome.outputs.chrome-path }} npm ci - npx serve ../../docs/demo -p 3000 & - npx cypress run - - name: Upload cypress artifacts (on failure) - uses: actions/upload-artifact@v4 - if: false - #if: ${{ failure() }} - with: - name: cypress-artifacts - path: |- - test/html5/cypress/screenshots - test/html5/cypress/videos + npm test - name: Upload export - if: false uses: actions/upload-artifact@v4 with: - name: html5-demo + name: web-demo path: docs/demo test: @@ -316,7 +307,7 @@ jobs: merge-artifacts: name: Merge Artifacts runs-on: ubuntu-latest - needs: [build-linux, build-other-platforms, test, html5-export] + needs: [build-linux, build-other-platforms, test, web-export] strategy: matrix: target: [release, debug] diff --git a/.gitignore b/.gitignore index b5dd769..2cb4eb2 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,7 @@ export.cfg export/ export_presets.cfg -# Dummy HTML5 export presets file for continuous integration +# Dummy Web export presets file for continuous integration !.github/dist/export_presets.cfg # Mono-specific ignores diff --git a/Justfile b/Justfile index d0ccc79..d21252f 100644 --- a/Justfile +++ b/Justfile @@ -8,6 +8,11 @@ godot := `echo "${GODOT:-godot} --rendering-driver ${RENDERING_DRIVER:-vulkan}"` build: cd addons/godot_xterm/native && scons debug_symbols=yes +build-javascript: + UID_GID="$(id -u):$(id -g)" docker-compose -f addons/godot_xterm/native/docker-compose.yml run --rm javascript + +build-all: build build-javascript + install: {{godot}} --headless -s plug.gd install diff --git a/addons/godot_xterm/native/docker-compose.yml b/addons/godot_xterm/native/docker-compose.yml index 81f0b1a..f57175c 100644 --- a/addons/godot_xterm/native/docker-compose.yml +++ b/addons/godot_xterm/native/docker-compose.yml @@ -11,10 +11,7 @@ services: - /bin/bash - -c - | - cd /src/thirdparty/godot-cpp - scons platform=javascript target=$${TARGET:-debug} -j$$(nproc) - cd /src - scons platform=javascript target=$${TARGET:-debug} -j$$(nproc) + scons platform=web target=$${TARGET:-template_debug} -j$$(nproc) libuv-linux: user: ${UID_GID} build: diff --git a/addons/godot_xterm/native/godot-xterm.gdextension b/addons/godot_xterm/native/godot-xterm.gdextension index 6809c91..ee8affc 100644 --- a/addons/godot_xterm/native/godot-xterm.gdextension +++ b/addons/godot_xterm/native/godot-xterm.gdextension @@ -9,6 +9,8 @@ linux.debug.x86_64 = "res://addons/godot_xterm/native/bin/libgodot-xterm.linux.t linux.release.x86_64 = "res://addons/godot_xterm/native/bin/libgodot-xterm.linux.template_release.x86_64.so" linux.debug.x86_32 = "res://addons/godot_xterm/native/bin/libgodot-xterm.linux.template_debug.x86_32.so" linux.release.x86_32 = "res://addons/godot_xterm/native/bin/libgodot-xterm.linux.template_release.x86_32.so" +web.debug.wasm32 = "res://addons/godot_xterm/native/bin/libgodot-xterm.web.template_debug.wasm32.wasm" +web.release.wasm32 = "res://addons/godot_xterm/native/bin/libgodot-xterm.web.template_release.wasm32.wasm" macos.debug = "res://addons/godot_xterm/native/bin/libgodot-xterm.macos.template_debug.framework" macos.release = "res://addons/godot_xterm/native/bin/libgodot-xterm.macos.template_release.framework" windows.debug.x86_64 = "res://addons/godot_xterm/native/bin/libgodot-xterm.windows.template_debug.x86_64.dll" diff --git a/docs/index.md b/docs/index.md index 06041b9..7c18661 100644 --- a/docs/index.md +++ b/docs/index.md @@ -10,7 +10,7 @@ GDNative terminal for Godot. Built using [libtsm](https://www.freedesktop.org/wiki/Software/libtsm/), [libuv](https://github.com/libuv/libuv), and [node-pty](https://github.com/microsoft/node-pty). -Primarily developed and tested on Linux, it also supports macOS with partial support for Windows and HTML5. See the [Features section](introduction.md#features) for more detail. +Primarily developed and tested on Linux, it also supports macOS with partial support for Windows and Web. See the [Features section](introduction.md#features) for more detail.