diff --git a/Dockerfile b/Dockerfile index 4b163660c4bba82c2b363b2c933148d0a47c7a8e..e2018bdb36b9fd51bd7c35da4cd8fd0a2d8c04ac 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,8 +4,6 @@ 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 zip unzip libfontconfig1 \ && rm -rf /var/lib/apt/lists/* @@ -18,6 +16,6 @@ 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 chmod +x /usr/bin/godot_* /usr/bin/butler_* && \ - godot_install $GODOT_VERSION $PLATFORM && cp ./godot /usr/bin/godot && \ - butler_install $BUTLER_VERSION \ No newline at end of file +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 diff --git a/commands/godot_install.sh b/commands/godot_install.sh index dd082247deef375aa2750bc84d99a4315583036f..9bed3b9e49e6a3e8263fc0c275b10419c5e932bb 100755 --- a/commands/godot_install.sh +++ b/commands/godot_install.sh @@ -3,13 +3,25 @@ VERSION="$1" PLATFORM="$2" -TMP_PATH="/tmp/godot" -mkdir -p "$TMP_PATH" +SAFE_VERSION=$(echo "$VERSION" | sed -nE 's/-/./p') + +TMP_ROOT="/tmp/godot" +mkdir -p "$TMP_ROOT" BINARY_NAME="Godot_v${VERSION}_${PLATFORM}" -TMP_PATH="$TMP_PATH/godot_${VERSION}_${PLATFORM}.zip" +TMP_PATH="$TMP_ROOT/godot_${VERSION}_${PLATFORM}.zip" +LOCAL_PATH="$HOME/.local/share/godot/export_templates/$SAFE_VERSION" + ARTIFACT_PATH="https://github.com/godotengine/godot-builds/releases/download/${VERSION}/${BINARY_NAME}.zip" +TEMPLATES_PATH="https://github.com/godotengine/godot/releases/download/${VERSION}/Godot_v${VERSION}_export_templates.tpz" wget -O "$TMP_PATH" "$ARTIFACT_PATH" unzip -o "$TMP_PATH" -d "$(pwd)" -mv "$BINARY_NAME" godot \ No newline at end of file +mv "$BINARY_NAME" /usr/bin/godot + +mkdir -p "$LOCAL_PATH" +wget -O "${TMP_ROOT}/templates.tpz" "$TEMPLATES_PATH" +unzip -o "${TMP_ROOT}/templates.tpz" -d "${TMP_ROOT}/godot_templates" +mv -r "${TMP_ROOT}/godot_templates/*" "$LOCAL_PATH/" + +rm -r "$TMP_ROOT" \ No newline at end of file