Add support for precise Project Zomboid versioning in builds and images. Include printGameVersion task, improve image tagging, and enhance CI/release workflows for hotfix handling.
ci / image (42, public) (push) Successful in 3m17s
ci / image (42, public) (push) Successful in 3m17s
This commit is contained in:
1 parent
c529b04ff0
commit
26ca1b90a2
9 files changed
+137
-34
No files matched your search
+38
-4
@@ -6,6 +6,10 @@
|
||||
# podman build --platform linux/amd64 -t zomboidforge .
|
||||
# podman build --build-arg PZ_BRANCH=42.19 --build-arg PZ_VERSION=42.19 ...
|
||||
#
|
||||
# The stage game-version (--target game-version) downloads only the server jar of
|
||||
# PZ_BRANCH and writes its game version to /game-version; ci/release.sh uses it to
|
||||
# name the image before the full build.
|
||||
#
|
||||
# Build arguments:
|
||||
# PZ_BRANCH Steam branch of app 380870: public, unstable, or a version branch (42.19, ...)
|
||||
# PZ_VERSION Expected Project Zomboid version; the build fails when the downloaded
|
||||
@@ -14,7 +18,8 @@
|
||||
# files with steamcmd's newer copies
|
||||
# FORGE_VERSION ZomboidForge version (jar manifest, image label); set by ci/release.sh.
|
||||
# Default: 0.0.0-prerelease
|
||||
# STEAM_BUILDID Image label only; set by ci/release.sh
|
||||
# STEAM_BUILDID Image label; in the stage game-version it keeps the cached result until
|
||||
# Steam publishes a new build. Set by ci/release.sh
|
||||
# DISABLED_PATCHES Comma-separated simple class names of build-time patches to skip
|
||||
# (debug builds only; ci/release.sh never sets it)
|
||||
|
||||
@@ -36,8 +41,8 @@ ARG STEAMCLIENT
|
||||
COPY docker/install-server.sh /usr/local/bin/install-server
|
||||
RUN install-server /server "${PZ_BRANCH}" "${STEAMCLIENT}"
|
||||
|
||||
# --- Stage 2: ZomboidForge build and server jar patching -----------------------
|
||||
FROM docker.io/library/eclipse-temurin:25-jdk AS build
|
||||
# --- Stage 2: ZomboidForge sources and Gradle -----------------------------------
|
||||
FROM docker.io/library/eclipse-temurin:25-jdk AS sources
|
||||
WORKDIR /src
|
||||
|
||||
# Gradle distribution download, cached independently of the sources.
|
||||
@@ -53,6 +58,35 @@ COPY agent agent
|
||||
COPY patcher patcher
|
||||
COPY mod-tools mod-tools
|
||||
COPY gradle-plugin gradle-plugin
|
||||
|
||||
# --- Game version of a Steam branch, from its server jar alone ------------------
|
||||
# Not part of the image; built on its own by ci/release.sh.
|
||||
FROM sources AS game-version
|
||||
|
||||
# DepotDownloader downloads single files of a depot; steamcmd only whole apps.
|
||||
ADD --checksum=sha256:a999dec66b4850fc961bd50366696d23c2d0fad7b18790e6a5647b2f19097a53 \
|
||||
https://github.com/SteamRE/DepotDownloader/releases/download/DepotDownloader_3.4.0/DepotDownloader-linux-x64.zip \
|
||||
/opt/depotdownloader/depotdownloader.zip
|
||||
RUN cd /opt/depotdownloader \
|
||||
&& jar xf depotdownloader.zip \
|
||||
&& chmod +x DepotDownloader \
|
||||
&& rm depotdownloader.zip
|
||||
|
||||
# FORGE_VERSION only keeps Gradle from asking git (not in this stage) for the version.
|
||||
ARG PZ_BRANCH
|
||||
ARG STEAM_BUILDID
|
||||
ARG FORGE_VERSION
|
||||
RUN echo java/projectzomboid.jar > /tmp/files \
|
||||
&& /opt/depotdownloader/DepotDownloader \
|
||||
-app 380870 -depot 380871 -branch "${PZ_BRANCH}" -filelist /tmp/files -dir /pz \
|
||||
&& ./gradlew --no-daemon --quiet \
|
||||
-Ppz.jar=/pz/java/projectzomboid.jar \
|
||||
-Pversion=${FORGE_VERSION} \
|
||||
:patcher:printGameVersion > /game-version
|
||||
|
||||
# --- Stage 3: ZomboidForge build and server jar patching -----------------------
|
||||
FROM sources AS build
|
||||
|
||||
COPY --from=server /server/java/projectzomboid.jar /pz/projectzomboid.jar
|
||||
|
||||
# An empty PZ_VERSION keeps pz.version from gradle.properties. FORGE_VERSION always has a
|
||||
@@ -67,7 +101,7 @@ RUN ./gradlew --no-daemon \
|
||||
${DISABLED_PATCHES:+-Pzf.disabledPatches=${DISABLED_PATCHES}} \
|
||||
build -x :gradle-plugin:test :patcher:patchServerJar
|
||||
|
||||
# --- Stage 3: runtime ------------------------------------------------------------
|
||||
# --- Stage 4: runtime ------------------------------------------------------------
|
||||
FROM docker.io/library/debian:trixie-slim
|
||||
|
||||
# ca-certificates: required by steamclient.so to connect to Steam.
|
||||
|
||||
Reference in new issue
Block a user