From 857348ee00bb4baefbb6dca462bda74214e32691 Mon Sep 17 00:00:00 2001 From: William Edwards Date: Fri, 26 Jan 2024 21:31:48 -0800 Subject: [PATCH] chore(CI): pin Godot Engine version in container image --- .github/workflows/docker.yaml | 7 +++++-- docker/Dockerfile | 19 ++++++++++++------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 753d5783..f2cd1c53 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -1,4 +1,4 @@ -# Build and push the Docker builder image which contain all of the build +# Build and push the Docker builder image which contain all of the build # dependencies for OpenGamepadUI name: Create and publish a Docker image @@ -27,5 +27,8 @@ jobs: - name: Log in to Docker registry run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - name: Build and push Docker image + - name: Build and push latest Docker image run: make docker-builder-push + + - name: Build and push versioned Docker image + run: make docker-builder-push IMAGE_TAG=$(grep 'ARG GODOT_VER' docker/Dockerfile | cut -d'=' -f2) diff --git a/docker/Dockerfile b/docker/Dockerfile index a73f3491..537ce6da 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -37,18 +37,23 @@ RUN pacman --noconfirm -Syyu && pacman -S --needed --noconfirm \ rpm-tools \ fontconfig \ zip \ - jq \ - godot + jq + +# Download and install the appropriate version of Godot +ARG GODOT_VERSION=4.2.1 +ARG GODOT_RELEASE=stable +RUN mkdir /tmp/godot && \ + wget -q https://github.com/godotengine/godot-builds/releases/download/${GODOT_VERSION}-${GODOT_RELEASE}/Godot_v${GODOT_VERSION}-${GODOT_RELEASE}_linux.x86_64.zip -O /tmp/godot/godot.zip && \ + cd /tmp/godot && \ + unzip godot.zip && \ + mv Godot_v*.x86_64 /usr/bin/godot # Create a home directory for the builder RUN mkdir -p /home/build/.local/share/godot/export_templates && chmod -R 777 /home/build # Download the Godot export template -RUN export GODOT_VERSION=$(godot --version) && \ - export RELEASE=$(echo ${GODOT_VERSION} | rev | cut -d'.' -f2 | rev) && \ - export VERSION=$(echo ${GODOT_VERSION} | grep -o '[0-9].*[0-9]') && \ - export TEMPLATE_DIR=/home/build/.local/share/godot/export_templates/${VERSION}.${RELEASE} && \ - export URL="https://github.com/godotengine/godot/releases/download/${VERSION}-${RELEASE}/Godot_v${VERSION}-${RELEASE}_export_templates.tpz" && \ +RUN export TEMPLATE_DIR=/home/build/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE} && \ + export URL="https://github.com/godotengine/godot/releases/download/${GODOT_VERSION}-${GODOT_RELEASE}/Godot_v${GODOT_VERSION}-${GODOT_RELEASE}_export_templates.tpz" && \ wget "${URL}" -O /home/build/.local/share/godot/export_templates/templates.zip && \ unzip /home/build/.local/share/godot/export_templates/templates.zip -d /home/build/.local/share/godot/export_templates/ && \ rm /home/build/.local/share/godot/export_templates/templates.zip && \