From dbb0909282bf37738019148baa68596f5925edea Mon Sep 17 00:00:00 2001 From: Fewwan <57836708+fewwan@users.noreply.github.com> Date: Mon, 19 Oct 2026 00:40:51 +0200 Subject: [PATCH] Add release selection for the GitHub-released server types (#4339) --- .github/workflows/build.yml | 8 +-- .github/workflows/verify-pr.yml | 2 +- .../server-types/hybrids.md | 4 ++ .../server-types/others.md | 32 +++++++++++- examples/ketting/docker-compose.yml | 2 + examples/pumpkin/compose.yml | 2 + scripts/start-deployArcLight | 33 +++++------- scripts/start-deployCrucible | 52 ++++++++----------- scripts/start-deployKetting | 13 ++++- scripts/start-deployNanoLimbo | 13 ++++- scripts/start-deployPoseidon | 15 ++++-- scripts/start-deployPumpkin | 24 ++++++++- .../arclight-release/docker-compose.yml | 13 +++++ .../setuponlytests/arclight-release/verify.sh | 1 + .../crucible-release/docker-compose.yml | 12 +++++ .../setuponlytests/crucible-release/verify.sh | 6 +++ .../ketting-release/docker-compose.yml | 12 +++++ .../setuponlytests/ketting-release/verify.sh | 1 + .../nanolimbo-release/docker-compose.yml | 11 ++++ .../nanolimbo-release/verify.sh | 1 + .../poseidon-release/docker-compose.yml | 12 +++++ .../setuponlytests/poseidon-release/verify.sh | 1 + .../pumpkin-release/docker-compose.yml | 11 ++++ .../setuponlytests/pumpkin-release/verify.sh | 7 +++ 24 files changed, 225 insertions(+), 63 deletions(-) create mode 100644 tests/setuponlytests/arclight-release/docker-compose.yml create mode 100644 tests/setuponlytests/arclight-release/verify.sh create mode 100644 tests/setuponlytests/crucible-release/docker-compose.yml create mode 100644 tests/setuponlytests/crucible-release/verify.sh create mode 100644 tests/setuponlytests/ketting-release/docker-compose.yml create mode 100644 tests/setuponlytests/ketting-release/verify.sh create mode 100644 tests/setuponlytests/nanolimbo-release/docker-compose.yml create mode 100644 tests/setuponlytests/nanolimbo-release/verify.sh create mode 100644 tests/setuponlytests/poseidon-release/docker-compose.yml create mode 100644 tests/setuponlytests/poseidon-release/verify.sh create mode 100644 tests/setuponlytests/pumpkin-release/docker-compose.yml create mode 100644 tests/setuponlytests/pumpkin-release/verify.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fe24c36e..8899b435 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -94,25 +94,25 @@ jobs: platforms: linux/amd64,linux/arm/v7,linux/arm64 mcVersion: 1.16.5 # Pin version for pre-Java 17 - mcHelperVersion: 1.51.4-java8 + mcHelperVersion: 1.51.5-java8 # JAVA 11 - variant: java11 baseImage: adoptopenjdk:11-jre-hotspot platforms: linux/amd64,linux/arm/v7,linux/arm64 mcVersion: 1.16.4 # Pin version for pre-Java 17 - mcHelperVersion: 1.51.4-java8 + mcHelperVersion: 1.51.5-java8 # JAVA 8: NOTE: Unable to go past 8u312 because of Forge dependencies - variant: java8 baseImage: eclipse-temurin:8-jre platforms: linux/amd64,linux/arm/v7,linux/arm64 mcVersion: 1.12.2 - mcHelperVersion: 1.51.4-java8 + mcHelperVersion: 1.51.5-java8 - variant: java8-jdk baseImage: eclipse-temurin:8-jdk platforms: linux/amd64,linux/arm64 mcVersion: 1.12.2 - mcHelperVersion: 1.51.4-java8 + mcHelperVersion: 1.51.5-java8 env: # Assume they line up, but when forked change to your Docker Hub username DOCKER_HUB_ORG: ${{ github.repository_owner }} diff --git a/.github/workflows/verify-pr.yml b/.github/workflows/verify-pr.yml index a0a3012f..87b9dcac 100644 --- a/.github/workflows/verify-pr.yml +++ b/.github/workflows/verify-pr.yml @@ -62,7 +62,7 @@ jobs: # For GLIBC_2.34 support knockdRepoOrg: Metalcape/knock # Pin version for Java 8, be sure to also set in build.yml - mcHelperVersion: 1.51.4-java8 + mcHelperVersion: 1.51.5-java8 env: IMAGE_TO_TEST: ${{ github.repository_owner }}/minecraft-server:test-${{ matrix.variant }}-${{ github.run_id }} runs-on: ubuntu-22.04 diff --git a/docs/types-and-platforms/server-types/hybrids.md b/docs/types-and-platforms/server-types/hybrids.md index 7217b1b3..96870203 100644 --- a/docs/types-and-platforms/server-types/hybrids.md +++ b/docs/types-and-platforms/server-types/hybrids.md @@ -35,6 +35,8 @@ There are limited base versions supported, so you will also need to set `VERSIO Available Ketting Versions may be found at [https://reposilite.c0d3m4513r.com/#/Ketting-Server-Releases/org/kettingpowered/server/forge](https://reposilite.c0d3m4513r.com/#/Ketting-Server-Releases/org/kettingpowered/server/forge). The Version structure is `MinecraftVersion-ForgeVersion-KettingVersion` (e.g. `1.20.1-47.2.20-0.1.4` is for Minecraft `1.20.1`, Forge `47.2.20` and Ketting `0.1.4`). +The launcher itself defaults to the latest release; set `KETTING_RELEASE` to a [specific release](https://github.com/kettingpowered/kettinglauncher/releases) tag, such as `v1.5.1`, to download that one instead. + ### Mohist A [Mohist](https://github.com/MohistMC/Mohist) server can be used with @@ -83,3 +85,5 @@ A [Arclight](https://arclight.izzel.io/) type server can be used with -e TYPE=ARCLIGHT -e ARCLIGHT_TYPE=NEOFORGE,FORGE,FABRIC + +By default the latest release is used; set `ARCLIGHT_RELEASE` to a [specific release](https://github.com/IzzelAliz/Arclight/releases) tag, such as `FeudalKings/1.0.1`, to run that one instead. A `VERSION` is still required to select the matching jar within the release. diff --git a/docs/types-and-platforms/server-types/others.md b/docs/types-and-platforms/server-types/others.md index 813c326b..12bc504f 100644 --- a/docs/types-and-platforms/server-types/others.md +++ b/docs/types-and-platforms/server-types/others.md @@ -47,6 +47,28 @@ Note: it is a fork of the original [NanoLimbo](https://github.com/Nan1t/NanoLimb An alternate Limbo server +Configuration options with defaults: + +- `NANOLIMBO_RELEASE`=latest + + The [NanoLimbo release](https://github.com/BoomEaro/NanoLimbo/releases) to download the server jar from, such as `1.13.0`. + +## Poseidon + +A [Poseidon](https://github.com/retromcorg/Project-Poseidon) server can be run by setting `TYPE` to `POSEIDON`. + +Poseidon is only available for b1.7.3, so be sure to set `VERSION=b1.7.3`. + +Configuration options with defaults: + +- `POSEIDON_RELEASE`=latest + + The [Poseidon release](https://github.com/retromcorg/Project-Poseidon/releases) to download, such as `1.1.12-260720-1033-5303bd5`. + +- `POSEIDON_TYPE`=poseidon + + Set to `uberbukkit` to use the [uberbukkit](https://github.com/Moresteck/uberbukkit) fork instead, whose releases are also selectable with `POSEIDON_RELEASE`. + ## Crucible A [Crucible](https://github.com/CrucibleMC/Crucible) server can be run by setting `TYPE` to `CRUCIBLE`. @@ -55,6 +77,8 @@ Configuration options with defaults: - `CRUCIBLE_RELEASE`=latest + The [Crucible release](https://github.com/CrucibleMC/Crucible/releases) to run, such as `v5.4`. Since `latest` only tracks full releases, a pre-release such as a `staging-*` tag has to be named explicitly. + Crucible is only available for 1.7.10, so be sure to set `VERSION=1.7.10`. ## Custom @@ -79,7 +103,7 @@ Alternatively, the final `-jar` invocation can be replaced by setting `CUSTOM_JA A [Pumpkin](https://pumpkinmc.org/) server can be run by setting `TYPE` to `PUMPKIN`. -Pumpkin is a Minecraft server written in Rust and is shipped as a single native executable instead of a Java jar. The image downloads the asset matching its architecture from the [latest release](https://github.com/Pumpkin-MC/Pumpkin/releases), so `VERSION` and the JVM memory and tuning variables do not apply. +Pumpkin is a Minecraft server written in Rust and is shipped as a single native executable instead of a Java jar. The image downloads the asset matching its architecture from the [latest release](https://github.com/Pumpkin-MC/Pumpkin/releases), so `VERSION` and the JVM memory and tuning variables do not apply. Set `PUMPKIN_RELEASE` to run a different release. ```shell docker run -d --pull=always -v /path/on/host:/data \ @@ -93,6 +117,12 @@ Configuration options with defaults: Set to true to re-download the executable. +- `PUMPKIN_RELEASE`=latest + + The [Pumpkin release](https://github.com/Pumpkin-MC/Pumpkin/releases) to run, such as `0.2.0+26.3-26.51`, or a moving prerelease channel like `nightly` or `canary`. `VERSION` selects the Minecraft version for other server types, so it is ignored here. + + Each release is downloaded to `/data/pumpkin--Linux`, and switching `PUMPKIN_RELEASE` replaces that executable. Set `FORCE_REDOWNLOAD=true` to re-download the selected release, which is useful to pick up a newer `nightly` or `canary` build. + Pumpkin is configured through `/data/pumpkin.toml`. The image creates that file on the first run and updates the settings below at each startup, leaving the remaining options in your file alone. Anything without a matching environment variable can be set by editing `pumpkin.toml` directly. | Variable | Pumpkin setting | diff --git a/examples/ketting/docker-compose.yml b/examples/ketting/docker-compose.yml index 4d3b8d94..4c00b76c 100644 --- a/examples/ketting/docker-compose.yml +++ b/examples/ketting/docker-compose.yml @@ -5,6 +5,8 @@ services: EULA: true TYPE: KETTING VERSION: 1.20.1 + # Optionally pin a specific Ketting launcher release instead of the latest + # KETTING_RELEASE: "v1.5.1" CURSEFORGE_FILES: https://www.curseforge.com/minecraft/mc-mods/aquaculture ports: - "25565:25565" \ No newline at end of file diff --git a/examples/pumpkin/compose.yml b/examples/pumpkin/compose.yml index 04b89e62..97071ec8 100644 --- a/examples/pumpkin/compose.yml +++ b/examples/pumpkin/compose.yml @@ -6,6 +6,8 @@ services: environment: EULA: "true" TYPE: PUMPKIN + # Optionally pin a specific Pumpkin release instead of the latest + # PUMPKIN_RELEASE: "0.2.0+26.3-26.51" ports: - "25565:25565" - "19132:19132/udp" diff --git a/scripts/start-deployArcLight b/scripts/start-deployArcLight index db2cf838..309a5856 100755 --- a/scripts/start-deployArcLight +++ b/scripts/start-deployArcLight @@ -10,27 +10,22 @@ resolveVersion : "${ARCLIGHT_RELEASE:=latest}" : "${ARCLIGHT_TYPE:=neoforge}" -arclightReleasesUrl=https://api.github.com/repos/IzzelAliz/Arclight/releases -if [[ ${ARCLIGHT_RELEASE^^} = LATEST ]]; then - arclightReleaseUrl=${arclightReleasesUrl}/latest -else - arclightReleaseUrl=${arclightReleasesUrl}/tags/${ARCLIGHT_RELEASE} -fi +# An omitted --release-tag means the latest release, so only pass it when a +# specific release was requested +arclightReleaseArgs=() +[[ ${ARCLIGHT_RELEASE} == latest ]] || arclightReleaseArgs+=(--release-tag="${ARCLIGHT_RELEASE}") -if ! downloadUrl=$(get --json-path "$.assets[?(@.name =~ /arclight-${ARCLIGHT_TYPE,,}-${VERSION}-.*\.jar/)].browser_download_url" \ - --accept "application/vnd.github.v3+json" "$arclightReleaseUrl"); then - logError "Failed to access ${ARCLIGHT_RELEASE} release of Arclight" - exit 1 -fi +arclightRepo=IzzelAliz/Arclight -if [[ $downloadUrl = null ]]; then - logError "Failed to locate Arclight jar for $VERSION from ${ARCLIGHT_RELEASE}" - exit 1 -fi - -log "Downloading Arclight from $downloadUrl" -if ! SERVER=$(get --skip-existing --output-filename -o /data "$downloadUrl"); then - logError "Arclight jar from $downloadUrl" +log "Downloading Arclight ${VERSION} ${ARCLIGHT_TYPE,,} from the ${ARCLIGHT_RELEASE} release" +if ! SERVER=$(mc-image-helper github download-asset \ + "${arclightReleaseArgs[@]}" \ + --output-directory=/data \ + --name-pattern="^arclight-${ARCLIGHT_TYPE,,}-${VERSION}-.+\.jar$" \ + ${arclightRepo} + ); then + logError "Failed to download Arclight jar for ${VERSION} from the ${ARCLIGHT_RELEASE} release" + logError "Ensure ARCLIGHT_RELEASE is one of the releases at ${arclightReleasesUrl}" exit 1 fi diff --git a/scripts/start-deployCrucible b/scripts/start-deployCrucible index 99d1af40..95ffd6e7 100755 --- a/scripts/start-deployCrucible +++ b/scripts/start-deployCrucible @@ -9,49 +9,43 @@ isDebugging && set -x resolveVersion : "${CRUCIBLE_RELEASE:=latest}" -crucibleReleasesUrl=https://api.github.com/repos/CrucibleMC/Crucible/releases -if [[ ${CRUCIBLE_RELEASE^^} = LATEST ]]; then - crucibleReleaseUrl=${crucibleReleasesUrl}/latest -else - crucibleReleaseUrl=${crucibleReleasesUrl}/tags/${CRUCIBLE_RELEASE} -fi +# An omitted --release-tag means the latest release, so only pass it when a +# specific release was requested +crucibleReleaseArgs=() +[[ ${CRUCIBLE_RELEASE} == latest ]] || crucibleReleaseArgs+=(--release-tag="${CRUCIBLE_RELEASE}") -if ! downloadUrl=$(get --json-path "$.assets[?(@.name =~ /Crucible-${VERSION}-.*\.jar/)].browser_download_url" \ - --accept "application/vnd.github.v3+json" "$crucibleReleaseUrl"); then - logError "Failed to access ${CRUCIBLE_RELEASE} release of Crucible" - exit 1 -fi +crucibleRepo=CrucibleMC/Crucible -if [[ $downloadUrl = null ]]; then - logError "Failed to locate Crucible jar for $VERSION from ${CRUCIBLE_RELEASE}" - exit 1 -fi - -log "Downloading Crucible from $downloadUrl" -if ! SERVER=$(get --skip-existing --output-filename -o /data "$downloadUrl"); then - logError "Crucible jar from $downloadUrl" +log "Downloading Crucible ${VERSION} from the ${CRUCIBLE_RELEASE} release" +if ! SERVER=$(mc-image-helper github download-asset \ + "${crucibleReleaseArgs[@]}" \ + --output-directory=/data \ + --name-pattern="^Crucible-${VERSION}-.+\.jar$" \ + ${crucibleRepo} + ); then + logError "Failed to download Crucible jar for ${VERSION} from the ${CRUCIBLE_RELEASE} release" + logError "Ensure CRUCIBLE_RELEASE is one of the releases at ${crucibleReleasesUrl}" exit 1 fi librariesDir=/data/libraries if [ ! -d "$librariesDir" ]; then - if ! librariesUrl=$(get --json-path "$.assets[?(@.name == 'libraries.zip')].browser_download_url" \ - --accept "application/vnd.github.v3+json" "$crucibleReleaseUrl"); then - logError "Failed to access ${CRUCIBLE_RELEASE} release of Crucible for libraries" + if ! librariesZip=$(mc-image-helper github download-asset \ + "${crucibleReleaseArgs[@]}" \ + --output-directory=/tmp \ + --name-pattern="^libraries\.zip$" \ + ${crucibleRepo} + ); then + logError "Failed to download Crucible libraries from the ${CRUCIBLE_RELEASE} release" exit 1 fi log "Downloading Crucible libraries" - if ! get -o /tmp/libraries.zip "$librariesUrl"; then - logError "Failed to download Crucible libraries from $librariesUrl" - exit 1 - fi - - if ! unzip /tmp/libraries.zip -d "$librariesDir"; then + if ! unzip "$librariesZip" -d "$librariesDir"; then logError "Failed to unzip Crucible libraries" exit 1 fi - rm /tmp/libraries.zip + rm "$librariesZip" fi export SERVER diff --git a/scripts/start-deployKetting b/scripts/start-deployKetting index 196d1697..80d036d0 100755 --- a/scripts/start-deployKetting +++ b/scripts/start-deployKetting @@ -4,12 +4,21 @@ . "$(dirname "$0")/start-utils" isDebugging && set -x -if ! SERVER=$(mc-image-helper github download-latest-asset \ +: "${KETTING_RELEASE:=latest}" + +# Only pass --release-tag when a specific release was requested; helper treats +# omitted as latest +kettingReleaseArgs=() +[[ ${KETTING_RELEASE} == latest ]] || kettingReleaseArgs+=(--release-tag="${KETTING_RELEASE}") + +if ! SERVER=$(mc-image-helper github download-asset \ + "${kettingReleaseArgs[@]}" \ --output-directory=/data \ --name-pattern="kettinglauncher-.+?(? "${pumpkinReleaseMarker}" + log "Using Pumpkin server executable ${SERVER}" if [[ ! -x "${SERVER}" ]]; then chmod +x "${SERVER}" diff --git a/tests/setuponlytests/arclight-release/docker-compose.yml b/tests/setuponlytests/arclight-release/docker-compose.yml new file mode 100644 index 00000000..53b56a49 --- /dev/null +++ b/tests/setuponlytests/arclight-release/docker-compose.yml @@ -0,0 +1,13 @@ +services: + mc: + restart: "no" + image: ${IMAGE_TO_TEST:-itzg/minecraft-server} + environment: + EULA: "TRUE" + SETUP_ONLY: "TRUE" + TYPE: ARCLIGHT + VERSION: "1.21.1" + ARCLIGHT_TYPE: "neoforge" + ARCLIGHT_RELEASE: "FeudalKings/1.0.0" + volumes: + - ./data:/data diff --git a/tests/setuponlytests/arclight-release/verify.sh b/tests/setuponlytests/arclight-release/verify.sh new file mode 100644 index 00000000..4721d7d5 --- /dev/null +++ b/tests/setuponlytests/arclight-release/verify.sh @@ -0,0 +1 @@ +mc-image-helper assert fileExists "/data/arclight-neoforge-1.21.1-1.0.0-3457560.jar" diff --git a/tests/setuponlytests/crucible-release/docker-compose.yml b/tests/setuponlytests/crucible-release/docker-compose.yml new file mode 100644 index 00000000..7133da39 --- /dev/null +++ b/tests/setuponlytests/crucible-release/docker-compose.yml @@ -0,0 +1,12 @@ +services: + mc: + restart: "no" + image: ${IMAGE_TO_TEST:-itzg/minecraft-server} + environment: + EULA: "TRUE" + SETUP_ONLY: "TRUE" + TYPE: CRUCIBLE + VERSION: "1.7.10" + CRUCIBLE_RELEASE: "v5.3" + volumes: + - ./data:/data diff --git a/tests/setuponlytests/crucible-release/verify.sh b/tests/setuponlytests/crucible-release/verify.sh new file mode 100644 index 00000000..56c74f5a --- /dev/null +++ b/tests/setuponlytests/crucible-release/verify.sh @@ -0,0 +1,6 @@ +mc-image-helper assert fileExists "/data/Crucible-1.7.10-5.3.jar" + +if [ ! -d /data/libraries ]; then + echo "Expected /data/libraries to have been extracted from libraries.zip" + exit 1 +fi diff --git a/tests/setuponlytests/ketting-release/docker-compose.yml b/tests/setuponlytests/ketting-release/docker-compose.yml new file mode 100644 index 00000000..abb7bba9 --- /dev/null +++ b/tests/setuponlytests/ketting-release/docker-compose.yml @@ -0,0 +1,12 @@ +services: + mc: + restart: "no" + image: ${IMAGE_TO_TEST:-itzg/minecraft-server} + environment: + EULA: "TRUE" + SETUP_ONLY: "TRUE" + TYPE: KETTING + VERSION: "1.20.1" + KETTING_RELEASE: "v1.5.1" + volumes: + - ./data:/data diff --git a/tests/setuponlytests/ketting-release/verify.sh b/tests/setuponlytests/ketting-release/verify.sh new file mode 100644 index 00000000..4bc2ae36 --- /dev/null +++ b/tests/setuponlytests/ketting-release/verify.sh @@ -0,0 +1 @@ +mc-image-helper assert fileExists "/data/kettinglauncher-*.jar" diff --git a/tests/setuponlytests/nanolimbo-release/docker-compose.yml b/tests/setuponlytests/nanolimbo-release/docker-compose.yml new file mode 100644 index 00000000..472e71a4 --- /dev/null +++ b/tests/setuponlytests/nanolimbo-release/docker-compose.yml @@ -0,0 +1,11 @@ +services: + mc: + restart: "no" + image: ${IMAGE_TO_TEST:-itzg/minecraft-server} + environment: + EULA: "TRUE" + SETUP_ONLY: "TRUE" + TYPE: NANOLIMBO + NANOLIMBO_RELEASE: "1.13.0" + volumes: + - ./data:/data diff --git a/tests/setuponlytests/nanolimbo-release/verify.sh b/tests/setuponlytests/nanolimbo-release/verify.sh new file mode 100644 index 00000000..a8f77348 --- /dev/null +++ b/tests/setuponlytests/nanolimbo-release/verify.sh @@ -0,0 +1 @@ +mc-image-helper assert fileExists "/data/NanoLimbo*.jar" diff --git a/tests/setuponlytests/poseidon-release/docker-compose.yml b/tests/setuponlytests/poseidon-release/docker-compose.yml new file mode 100644 index 00000000..c49a5659 --- /dev/null +++ b/tests/setuponlytests/poseidon-release/docker-compose.yml @@ -0,0 +1,12 @@ +services: + mc: + restart: "no" + image: ${IMAGE_TO_TEST:-itzg/minecraft-server} + environment: + EULA: "TRUE" + SETUP_ONLY: "TRUE" + TYPE: POSEIDON + VERSION: "b1.7.3" + POSEIDON_RELEASE: "1.1.12-260720-1033-5303bd5" + volumes: + - ./data:/data diff --git a/tests/setuponlytests/poseidon-release/verify.sh b/tests/setuponlytests/poseidon-release/verify.sh new file mode 100644 index 00000000..98c67c10 --- /dev/null +++ b/tests/setuponlytests/poseidon-release/verify.sh @@ -0,0 +1 @@ +mc-image-helper assert fileExists "/data/poseidon-craftbukkit-*.jar" diff --git a/tests/setuponlytests/pumpkin-release/docker-compose.yml b/tests/setuponlytests/pumpkin-release/docker-compose.yml new file mode 100644 index 00000000..bd0ddcb0 --- /dev/null +++ b/tests/setuponlytests/pumpkin-release/docker-compose.yml @@ -0,0 +1,11 @@ +services: + mc: + restart: "no" + image: ${IMAGE_TO_TEST:-itzg/minecraft-server} + environment: + EULA: "TRUE" + SETUP_ONLY: "TRUE" + TYPE: PUMPKIN + PUMPKIN_RELEASE: "0.2.0+26.3-26.51" + volumes: + - ./data:/data diff --git a/tests/setuponlytests/pumpkin-release/verify.sh b/tests/setuponlytests/pumpkin-release/verify.sh new file mode 100644 index 00000000..8ec81658 --- /dev/null +++ b/tests/setuponlytests/pumpkin-release/verify.sh @@ -0,0 +1,7 @@ +mc-image-helper assert fileExists "/data/pumpkin-*-Linux*" + +actual=$(<"/data/.pumpkin-release") +if [[ ${actual} != "0.2.0+26.3-26.51" ]]; then + echo "Expected /data/.pumpkin-release to be '0.2.0+26.3-26.51', but was '${actual}'" + exit 1 +fi