diff --git a/Dockerfile b/Dockerfile index 042659439db1f13e481800f291ab9bc6ec9bce58..01138015da99d34a88215564bde63421c7a952ec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,12 +2,21 @@ FROM debian:12.8-slim ARG PLATFORM="linux.x86_64" ARG GODOT_VERSION="4.3-stable" +ARG BUTLER_VERSION="15.12.0" + +ENV BUTLER_API_KEY="" RUN apt-get update \ - && apt-get install -y wget unzip libfontconfig1 \ + && apt-get install -y wget zip unzip libfontconfig1 \ && rm -rf /var/lib/apt/lists/* COPY commands/godot_build.sh /usr/bin/godot_build +COPY commands/godot_build_web.sh /usr/bin/godot_build_web COPY commands/godot_install.sh /usr/bin/godot_install +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 -RUN godot_install $GODOT_VERSION $PLATFORM && cp ./godot /usr/bin/godot \ No newline at end of file +RUN godot_install $GODOT_VERSION $PLATFORM && cp ./godot /usr/bin/godot +RUN butler_install $BUTLER_VERSION \ No newline at end of file diff --git a/commands/butler_install.sh b/commands/butler_install.sh new file mode 100755 index 0000000000000000000000000000000000000000..2330e3d84c915ea34956bdb5562d92acc5f645f3 --- /dev/null +++ b/commands/butler_install.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +BUTLER_VERSION="$1" +BUTLER_URL="https://broth.itch.ovh/butler/linux-amd64/${BUTLER_VERSION}/archive/default" + +mkdir -p /tmp/butler + +wget -L -O /tmp/butler/butler.zip "$BUTLER_URL" +unzip -d /tmp/butler /tmp/butler/butler.zip +chmod +x /tmp/butler/butler +mv /tmp/butler/butler /usr/bin/butler + +rm -r /tmp/butler \ No newline at end of file diff --git a/commands/butler_upload.sh b/commands/butler_upload.sh new file mode 100755 index 0000000000000000000000000000000000000000..b5df0d7a4c9225d053f39ea8eadf1071d88cfe4a --- /dev/null +++ b/commands/butler_upload.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +PROJECT_PATH="$1" +USERNAME=$(echo "$2" | cut -d "/" -f 1) +PROJECT_NAME=$(echo "$2" | cut -d "/" -f 2) +PLATFORM="$3" + +CHANNEL_NAME="${PROJECT_NAME}-${PLATFORM}" + +butler push "$PROJECT_PATH" "${USERNAME}/${PROJECT_NAME}:${CHANNEL_NAME}" \ No newline at end of file diff --git a/commands/godot_build_web.sh b/commands/godot_build_web.sh new file mode 100644 index 0000000000000000000000000000000000000000..9ee753b2429afc3fb515b5858484baea2e034000 --- /dev/null +++ b/commands/godot_build_web.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +NAME="$1" +PRESET="$2" +PROJECT_PATH="$3" + +OUTPUT_PATH="$(pwd)/${NAME}" + +mkdir -p "OUTPUT_PATH" +godot --headless --export-debug "${PRESET}" "${OUTPUT_PATH}/index" "${PROJECT_PATH}/project.godot" \ No newline at end of file diff --git a/commands/godot_project_title.sh b/commands/godot_project_title.sh new file mode 100755 index 0000000000000000000000000000000000000000..a58b327dc86a342ef8ba31c1c676b5558fda12ec --- /dev/null +++ b/commands/godot_project_title.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +PROJECT_PATH="$1" +PROJECT_NAME=$(sed -nE 's/^config\/name="(.*)"/\1/p' < ${PROJECT_PATH}/project.godot) +echo "$PROJECT_NAME" \ No newline at end of file