Skip to content

Commit

Permalink
chore(CI): pin Godot Engine version in container image
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadowApex committed Jan 27, 2024
1 parent ad3ed15 commit 857348e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)
19 changes: 12 additions & 7 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand Down

0 comments on commit 857348e

Please sign in to comment.