diff --git a/Dockerfile b/Dockerfile index e2018bdb36b9fd51bd7c35da4cd8fd0a2d8c04ac..b80a42041bb779a816da89b6a8ee2b8af1d0cf5c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,11 @@ -FROM debian:12.8-slim +FROM cr.weirdboi.dev/base/rust:1-82-node-22 ARG PLATFORM="linux.x86_64" ARG GODOT_VERSION="4.3-stable" ARG BUTLER_VERSION="15.12.0" RUN apt-get update \ - && apt-get install -y wget zip unzip libfontconfig1 \ + && apt-get install -y git libfontconfig1 \ && rm -rf /var/lib/apt/lists/* COPY commands/godot_build.sh /usr/bin/godot_build @@ -16,6 +16,17 @@ COPY commands/godot_project_title.sh /usr/bin/godot_project_title COPY commands/butler_install.sh /usr/bin/butler_install COPY commands/butler_upload.sh /usr/bin/butler_upload +COPY commands/emsdk_install.sh /usr/bin/emsdk_install + +RUN rustup component add rust-src --toolchain nightly && \ + rustup target add wasm32-unknown-emscripten --toolchain nightly + RUN chmod +x /usr/bin/godot_* /usr/bin/butler_* RUN godot_install $GODOT_VERSION $PLATFORM -RUN butler_install $BUTLER_VERSION \ No newline at end of file +RUN butler_install $BUTLER_VERSION + +ENV EMSDK=/usr/bin/emsdk +RUN emsdk_install "${EMSDK}" + +ENV EMSDK_NODE="${EMSDK}/node/20.18.0_64bit/bin/node" +ENV PATH="${EMSDK}:${EMSDK}/upstream/emscripten:${PATH}" \ No newline at end of file diff --git a/README.md b/README.md index d64ce7d9102ab241e97b4058f56ba8f54cf9c87c..1d14569d06178431b9941a38726dc56e3bedbc88 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ ## Godot Builder -A base debian image, configured with tools and helpers required to build godot games in CI +A base debian image, configured with tools and helpers required to build godot games in CI. + +Additionally includes all tools & dependencies to build web content with Node, and Rust extensions +with Rust & emscripten ### Commands diff --git a/commands/emsdk_install.sh b/commands/emsdk_install.sh new file mode 100755 index 0000000000000000000000000000000000000000..8d036ccef805599e08a5d55975fa5da77b93a8bc --- /dev/null +++ b/commands/emsdk_install.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +INSTALL_DIR="$1" +FULL_DIR="$INSTALL_DIR/emsdk" + +mkdir -p "$FULL_DIR" +git clone https://github.com/emscripten-core/emsdk.git "$FULL_DIR" +cd "$FULL_DIR" +"$FULL_DIR/emsdk" install 3.1.62 +"$FULL_DIR/emsdk" activate 3.1.62 +source "$FULL_DIR/emsdk.sh" \ No newline at end of file