From 9592e64ad1f8b0f7d633800612a57ea998f8ef81 Mon Sep 17 00:00:00 2001 From: Snoweuph Date: Thu, 30 Jan 2025 12:01:59 +0100 Subject: [PATCH] Redot Image - Two Stage Build --- images/actions/redot/Dockerfile | 52 +++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 12 deletions(-) diff --git a/images/actions/redot/Dockerfile b/images/actions/redot/Dockerfile index 976d39a..bf00a38 100644 --- a/images/actions/redot/Dockerfile +++ b/images/actions/redot/Dockerfile @@ -1,4 +1,23 @@ -FROM git.euph.dev/actions/runner-basic-glib:latest +FROM alpine:latest AS build-stage + +ARG PACKAGE_VERSION + +RUN apk add --no-cache curl + +RUN wget $( \ + curl -s https://api.github.com/repos/Redot-Engine/redot-engine/releases/tags/redot-$PACKAGE_VERSION-stable \ + | grep "browser_download_url.*Redot_v.*-stable_export_templates\.tpz" \ + | cut -d '"' -f 4 - \ + | head -n 1 \ + ) -O Redot_Export_Templates.tbz + +RUN unzip Redot_Export_Templates.tbz + +RUN rm -f templates/*debug* + +RUN rm Redot_Export_Templates.tbz + +FROM git.euph.dev/actions/runner-basic-glib:latest AS final-stage ARG PACKAGE_VERSION @@ -27,15 +46,24 @@ RUN wget $( \ && sudo mv ./Redot_v*-stable_linux.x86_64 /usr/local/bin/redot \ && rm Redot.zip -RUN wget $( \ - curl -s https://api.github.com/repos/Redot-Engine/redot-engine/releases/tags/redot-$PACKAGE_VERSION-stable \ - | grep "browser_download_url.*Redot_v.*-stable_export_templates\.tpz" \ - | cut -d '"' -f 4 - \ - | head -n 1 \ - ) -O Redot_Export_Templates.tbz \ - && sudo tar --extract --file=Redot_Export_Templates.tbz --wildcards --no-anchored --exclude='*debug*' -C templates \ - && sudo unzip Redot_Export_Templates.tbz \ - && mkdir -p /home/runner/.local/share/redot/export_templates \ - && sudo mv ./templates /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable \ - && rm Redot_Export_Templates.tbz +RUN mkdir -p /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable +COPY --from=build-stage /templates/android_release.apk /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable/ +COPY --from=build-stage /templates/android_source.zip /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable/ +COPY --from=build-stage /templates/ios.zip /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable/ +COPY --from=build-stage /templates/linux_release.arm32 /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable/ +COPY --from=build-stage /templates/linux_release.arm64 /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable/ +COPY --from=build-stage /templates/linux_release.x86_32 /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable/ +COPY --from=build-stage /templates/linux_release.x86_64 /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable/ +COPY --from=build-stage /templates/macos.zip /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable/ +COPY --from=build-stage /templates/version.txt /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable/ +COPY --from=build-stage /templates/web_dlink_nothreads_release.zip /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable/ +COPY --from=build-stage /templates/web_dlink_release.zip /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable/ +COPY --from=build-stage /templates/web_nothreads_release.zip /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable/ +COPY --from=build-stage /templates/web_release.zip /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable/ +COPY --from=build-stage /templates/windows_release_arm64_console.exe /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable/ +COPY --from=build-stage /templates/windows_release_arm64.exe /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable/ +COPY --from=build-stage /templates/windows_release_x86_32_console.exe /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable/ +COPY --from=build-stage /templates/windows_release_x86_32.exe /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable/ +COPY --from=build-stage /templates/windows_release_x86_64_console.exe /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable/ +COPY --from=build-stage /templates/windows_release_x86_64.exe /home/runner/.local/share/redot/export_templates/$PACKAGE_VERSION.stable/