From 113c37bf3407a9fae655f354a0bd85f689cb45bd Mon Sep 17 00:00:00 2001 From: Ronoaldo JLP Date: Sat, 24 Aug 2024 15:31:20 -0300 Subject: [PATCH 1/4] feat: update to Minetest 5.9 Closes #22 Closes #23 Closes #24 --- .github/workflows/multiarch.yaml | 11 ++++++----- Dockerfile | 23 +++++++++++++---------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/.github/workflows/multiarch.yaml b/.github/workflows/multiarch.yaml index cc4f1b2..13187d9 100644 --- a/.github/workflows/multiarch.yaml +++ b/.github/workflows/multiarch.yaml @@ -25,9 +25,10 @@ jobs: args: |- MINETEST_VERSION=master MINETEST_GAME_VERSION=master - MINETEST_IRRLICHT_VERSION=master + MINETEST_IRRLICHT_VERSION=none + LUAJIT_VERSION=v2.1 tags: |- - 5.8.0-dev + 5.10.0-dev unstable dev platforms: |- @@ -35,9 +36,9 @@ jobs: linux/arm64 - dockerfile: Dockerfile args: |- - MINETEST_VERSION=5.8.0 - MINETEST_GAME_VERSION=5.8.0 - MINETEST_IRRLICHT_VERSION=1.9.0mt13 + MINETEST_VERSION=5.9.0 + MINETEST_GAME_VERSION=4e402ec39fb1852b148e62637df0b72ae70ecd7d + LUAJIT_VERSION=4e402ec39fb1852b148e62637df0b72ae70ecd7d tags: |- stable stable-5 diff --git a/Dockerfile b/Dockerfile index 8aa3ca5..92fa1c6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,15 @@ # Build stage FROM debian:bookworm-slim AS builder -# Build-time arguments +# Build-time arguments - defaults to dev build of more recent version ARG MINETEST_VERSION=master ARG MINETEST_GAME_VERSION=master -ARG MINETEST_IRRLICHT_VERSION=master +ARG MINETEST_IRRLICHT_VERSION=none +# LuaJIT rolling stable branch is v2.1 +ARG LUAJIT_VERSION=v2.1 + ARG MINETOOLS_VERSION=v0.2.2 -# Using a specific and newer LuaJIT commit to fix several ARM issues -# and crashes. This commit uses the unrelease v2.1 branch. -ARG LUAJIT_VERSION=505e2c03de35e2718eef0d2d3660712e06dadf1f +ENV MINETOOLS_DL_URL=https://github.com/ronoaldo/minetools/releases/download # Install all build-dependencies RUN apt-get update &&\ @@ -29,9 +30,11 @@ RUN mkdir -p /usr/src &&\ RUN git clone --depth=1 -b ${MINETEST_GAME_VERSION} \ https://github.com/minetest/minetest_game.git \ /usr/src/minetest/games/minetest_game -RUN git clone --depth=1 -b ${MINETEST_IRRLICHT_VERSION} \ +RUN if [ "${MINETEST_IRRLICHT_VERSION}" != "none" ] ; then \ + git clone --depth=1 -b ${MINETEST_IRRLICHT_VERSION} \ https://github.com/minetest/irrlicht \ - /usr/src/minetest/lib/irrlichtmt + /usr/src/minetest/lib/irrlichtmt ; \ + fi RUN git clone \ https://github.com/LuaJIT/LuaJIT.git \ /usr/src/luajit &&\ @@ -45,13 +48,13 @@ RUN echo "Building for arch $(uname -m)" &&\ *) echo "Unsupported arch $(uname -m)" ; exit 1 ;; \ esac &&\ curl -SsL --fail \ - https://github.com/ronoaldo/minetools/releases/download/${MINETOOLS_VERSION}/contentdb-linux-${ARCH}.zip > /tmp/minetools.zip &&\ + ${MINETOOLS_DL_URL}/${MINETOOLS_VERSION}/contentdb-linux-${ARCH}.zip > /tmp/minetools.zip &&\ cd /tmp/ && unzip minetools.zip && mv dist/contentdb /usr/bin &&\ rm /tmp/minetools.zip # Build LuaJIT WORKDIR /usr/src/luajit -RUN sed -e 's/PREREL=.*/PREREL=-beta4-mercurio/g' -i Makefile +RUN sed -e 's/PREREL=.*/PREREL=-rolling/g' -i Makefile RUN make PREFIX=/usr &&\ make install PREFIX=/usr &&\ make install PREFIX=/usr DESTDIR=/opt/luajit @@ -93,4 +96,4 @@ ADD minetest-wrapper.sh /usr/bin WORKDIR /var/lib/minetest USER minetest EXPOSE 30000/udp 30000/tcp -CMD ["/usr/bin/minetest-wrapper.sh", "--config", "/etc/minetest/minetest.conf"] +CMD ["/usr/bin/minetest-wrapper.sh", "--config", "/etc/minetest/minetest.conf", "--gameid", "minetest"] From cb9c466b7612e2bbbb441cecf3b61c2671fe7d16 Mon Sep 17 00:00:00 2001 From: Ronoaldo JLP Date: Sat, 24 Aug 2024 15:32:23 -0300 Subject: [PATCH 2/4] feat: added Makefile to make testing easier --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1a8dd3d --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ +IMAGE=ghcr.io/ronoaldo/minetestserver +TAG=latest + +build: + docker build -t ${IMAGE}:${TAG} . + +run: build + docker run --rm --name minetestserver -it -P ${IMAGE}:${TAG} From bf357e66e576ff5bebcbb5ed01514a3542cd2528 Mon Sep 17 00:00:00 2001 From: Ronoaldo JLP Date: Sat, 24 Aug 2024 15:39:31 -0300 Subject: [PATCH 3/4] fix: properly checkout minetest_game. Allowing to use a hash instead of branch name now that they have rolling release. --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 92fa1c6..2ba97d7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,14 +27,14 @@ RUN mkdir -p /usr/src &&\ https://github.com/minetest/minetest.git \ /usr/src/minetest &&\ rm -rf /usr/src/minetest/.git -RUN git clone --depth=1 -b ${MINETEST_GAME_VERSION} \ - https://github.com/minetest/minetest_game.git \ - /usr/src/minetest/games/minetest_game RUN if [ "${MINETEST_IRRLICHT_VERSION}" != "none" ] ; then \ git clone --depth=1 -b ${MINETEST_IRRLICHT_VERSION} \ https://github.com/minetest/irrlicht \ /usr/src/minetest/lib/irrlichtmt ; \ fi +RUN git clone --depth=1 https://github.com/minetest/minetest_game.git \ + /usr/src/minetest/games/minetest_game &&\ + git -C /usr/src/minetest/games/minetest_game checkout ${MINETEST_GAME_VERSION} RUN git clone \ https://github.com/LuaJIT/LuaJIT.git \ /usr/src/luajit &&\ From 2efdf20a3c6b6c10f14e01f2187593eeb9af437a Mon Sep 17 00:00:00 2001 From: Ronoaldo JLP Date: Sat, 24 Aug 2024 17:07:18 -0300 Subject: [PATCH 4/4] fix: properly assigned/tested LuaJIT hash. Added a local make target to verify that info from .github/workflows is correct. --- .github/workflows/multiarch.yaml | 2 +- Makefile | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/multiarch.yaml b/.github/workflows/multiarch.yaml index 13187d9..5da7648 100644 --- a/.github/workflows/multiarch.yaml +++ b/.github/workflows/multiarch.yaml @@ -38,7 +38,7 @@ jobs: args: |- MINETEST_VERSION=5.9.0 MINETEST_GAME_VERSION=4e402ec39fb1852b148e62637df0b72ae70ecd7d - LUAJIT_VERSION=4e402ec39fb1852b148e62637df0b72ae70ecd7d + LUAJIT_VERSION=f725e44cda8f359869bf8f92ce71787ddca45618 tags: |- stable stable-5 diff --git a/Makefile b/Makefile index 1a8dd3d..332468b 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,4 @@ +SHELL=bash IMAGE=ghcr.io/ronoaldo/minetestserver TAG=latest @@ -6,3 +7,15 @@ build: run: build docker run --rm --name minetestserver -it -P ${IMAGE}:${TAG} + +build-workflow-matrix: + @for i in $$(seq 0 1) ; do \ + MATRIX="$$(yq -r ".jobs.\"multiarch-build\".strategy.matrix.include[$$i] | .args" \ + < .github/workflows/multiarch.yaml)" ;\ + while read arg ; do export ARGS="$${ARGS} --build-arg $${arg}" ; done <<<"$${MATRIX}"; \ + docker buildx build \ + $${ARGS} \ + --file Dockerfile \ + --platform linux/amd64 \ + . ; \ + done