Use default export templates for HTML5

Changes Emscripten SDK version to match that used to compile the default export
templates used by Godot 3.5 (in this case 3.1.14 as can be seen here:
https://github.com/godotengine/build-containers/blob/3.5/Dockerfile.javascript).

This means we no longer need to compile custom export templates when
exporting HTML5 for Godot 3.5. Exports from other Godot versions may
requiring compiling the GDNative library with a different version of the
Emscripten SDK.

- Changes renderer from GLES3 -> GLES2 and reduces MSAA level to better
  support HTML5 export.
- Updates GitHub Action to export HTML5 and upload as a build artifact.
- Adds Cypress test to smoke test HTML5 export.
This commit is contained in:
Leroy Hopson 2022-08-01 19:56:43 +12:00
parent 2fa2322d7c
commit 10b9764fb3
No known key found for this signature in database
GPG key ID: D2747312A6DB51AA
26 changed files with 4896 additions and 118 deletions

View file

@ -1,4 +0,0 @@
# For convenient building of the library and gdnative export templates targeted at the javacript platform.
FROM emscripten/emsdk:3.1.5
RUN apt-get update && apt-get install pkg-config python3 -y
RUN pip3 install scons

View file

@ -1,41 +0,0 @@
set -e
# Parse args.
args=$@
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
-t|--target)
target="$2"
shift
shift
;;
*)
echo "Usage: ./build.sh [-t|--target <release|debug>]";
exit 128
shift
;;
esac
done
# Set defaults.
target=${target:-debug}
# Get the absolute path to the directory this script is in.
EXPORT_TEMPLATES_DIR="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
# Update git submodules.
GODOT_DIR=${EXPORT_TEMPLATES_DIR}/godot
if [ -z "$(ls -A -- "$GODOT_DIR")" ]; then
cd ${EXPORT_TEMPLATES_DIR}
git submodule update --init --recursive -- $GODOT_DIR
fi
# Use Docker to build HTML5 GDNative export templates.
UID_GID="0:0" docker-compose build javascript
UID_GID="$(id -u):$(id -g)" docker-compose run -e TARGET=$target javascript
if [ "$target" == "debug" ]; then
mv godot/bin/godot.javascript.debug.gdnative.zip godot/bin/webassembly_gdnative_debug.zip
else
mv godot/bin/godot.javascript.opt.gdnative.zip godot/bin/webassembly_gdnative_release.zip
fi

View file

@ -1,12 +0,0 @@
services:
javascript:
build: ../docker
user: ${UID_GID}
volumes:
- ./godot:/src
command:
- /bin/bash
- -c
- |
cd src
scons platform=javascript tools=no gdnative_enabled=yes target=$${TARGET} -j$$(nproc)

@ -1 +0,0 @@
Subproject commit 419e713a29f20bd3351a54d1e6c4c5af7ef4b253

View file

@ -1 +0,0 @@
HTML5 GDNative export templates are not provided, this is just a convient script/docker-compose file for building them locally.