diff --git a/.github/workflows/build-multiarch.yml b/.github/workflows/build-multiarch.yml index 402226b13e6..5b7b8700f02 100644 --- a/.github/workflows/build-multiarch.yml +++ b/.github/workflows/build-multiarch.yml @@ -34,19 +34,19 @@ jobs: # jammy doesn't work until minecraft updates to https://github.com/netty/netty/issues/12343 baseImage: eclipse-temurin:17-jre-focal platforms: linux/amd64,linux/arm/v7,linux/arm64 - mcVersion: LATEST + mcVersion: 1.18.2 - variant: java17-jdk baseImage: eclipse-temurin:17-focal platforms: linux/amd64,linux/arm/v7,linux/arm64 - mcVersion: LATEST + mcVersion: 1.18.2 - variant: java17-openj9 baseImage: ibm-semeru-runtimes:open-17-jre platforms: linux/amd64,linux/arm64 - mcVersion: LATEST + mcVersion: 1.18.2 - variant: java17-alpine baseImage: eclipse-temurin:17-jre-alpine platforms: linux/amd64 - mcVersion: LATEST + mcVersion: 1.18.2 # JAVA 11: - variant: java11 baseImage: adoptopenjdk:11-jre-hotspot diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 1f5b9cbed0e..d940a3d58ac 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -34,7 +34,7 @@ jobs: - name: Run tests env: MODS_FORGEAPI_KEY: ${{ secrets.MODS_FORGEAPI_KEY }} - MINECRAFT_VERSION: LATEST + MINECRAFT_VERSION: 1.18.2 run: | tests/test.sh push: diff --git a/scripts/start-deployPaper b/scripts/start-deployPaper index c84d2727689..a0f83901a3d 100755 --- a/scripts/start-deployPaper +++ b/scripts/start-deployPaper @@ -4,6 +4,30 @@ set -o pipefail isDebugging && set -x +ourScript="$0" +ourArgs=("$@") + +function handleMissingVersion() { + expectedVersion=${VANILLA_VERSION} + versions=$(curl -fsSL "https://papermc.io/api/v2/projects/paper" -H "accept: application/json") + if [[ $VERSION = LATEST ]]; then + tries=0 + while ((tries++ < 5)); do + VANILLA_VERSION=$(echo "$versions" | jq -r ".versions[$((- tries))]") + if [[ $(curl -fsSL "https://papermc.io/api/v2/projects/paper/versions/${VANILLA_VERSION}" -H "accept: application/json" \ + | jq '.builds[-1]') != null ]]; then + log "WARN: using ${VANILLA_VERSION} since that's the latest provided by PaperMC" + # re-execute the current script with the newly computed version + exec "$ourScript" "${ourArgs[@]}" + fi + done + fi + log "ERROR: ${expectedVersion} is not published by PaperMC" + log " Set VERSION to one of the following: " + log " $(echo "$versions" | jq -r '.versions | join(", ")')" + exit 1 +} + if [[ $PAPER_DOWNLOAD_URL ]]; then export SERVER=$(getFilenameFromUrl "${PAPER_DOWNLOAD_URL}") @@ -23,26 +47,16 @@ else 0) ;; 22) - versions=$(curl -fsSL "https://papermc.io/api/v2/projects/paper" -H "accept: application/json") - if [[ $VERSION = LATEST ]]; then - VANILLA_VERSION=$(echo "$versions" | jq -r '.versions[-1]') - log "WARN: using ${VANILLA_VERSION} since that's the latest provided by PaperMC" - # re-execute the current script with the newly computed version - exec "$0" "$@" - fi - log "ERROR: ${VANILLA_VERSION} is not published by PaperMC" - log " Set VERSION to one of the following: " - log " $(echo "$versions" | jq -r '.versions | join(", ")')" - exit 1 + handleMissingVersion ;; *) echo "ERROR: unknown error while looking up PaperMC version=${VANILLA_VERSION}" exit 1 ;; esac - if [ $? != 0 ]; then - echo "ERROR: failed to lookup PaperMC build from version ${VANILLA_VERSION}" - exit 1 + + if [[ $build = null ]]; then + handleMissingVersion fi export SERVER=$(curl -fsSL "https://papermc.io/api/v2/projects/paper/versions/${VANILLA_VERSION}/builds/${build}" -H "accept: application/json" \ diff --git a/tests/setuponlytests/forgeapimods_file/docker-compose.yml b/tests/setuponlytests/forgeapimods_file/docker-compose.yml index 9e1959b4373..58c313ae572 100644 --- a/tests/setuponlytests/forgeapimods_file/docker-compose.yml +++ b/tests/setuponlytests/forgeapimods_file/docker-compose.yml @@ -13,7 +13,7 @@ services: # Using family to test FORGEAPI Family filter. FAMILY: FABRIC CUSTOM_SERVER: /servers/fake.jar - VERSION: ${MINECRAFT_VERSION:-LATEST} + VERSION: 1.18.2 MODS_FORGEAPI_FILE: /config/forgeapi_mods.json # Key is defined in .github/workflows/pr.yml and ci.yml # This should be coming from github secrets. diff --git a/tests/setuponlytests/forgeapimods_gametype/docker-compose.yml b/tests/setuponlytests/forgeapimods_gametype/docker-compose.yml index c14140f003e..3373b595fd7 100644 --- a/tests/setuponlytests/forgeapimods_gametype/docker-compose.yml +++ b/tests/setuponlytests/forgeapimods_gametype/docker-compose.yml @@ -13,7 +13,7 @@ services: # Using family to test FORGEAPI Family filter. FAMILY: FABRIC CUSTOM_SERVER: /servers/fake.jar - VERSION: ${MINECRAFT_VERSION:-LATEST} + VERSION: 1.18.2 # Validate Skip Gametype Filter: MODS_FORGEAPI_IGNORE_GAMETYPE: "TRUE" # Validates that Biomes does not download terrablender diff --git a/tests/setuponlytests/forgeapimods_projectids/docker-compose.yml b/tests/setuponlytests/forgeapimods_projectids/docker-compose.yml index ab29770058d..418f118b1fe 100644 --- a/tests/setuponlytests/forgeapimods_projectids/docker-compose.yml +++ b/tests/setuponlytests/forgeapimods_projectids/docker-compose.yml @@ -13,7 +13,7 @@ services: # - Currently we do not support filtering on vanilla. FAMILY: VANILLA CUSTOM_SERVER: /servers/fake.jar - VERSION: ${MINECRAFT_VERSION:-LATEST} + VERSION: 1.18.2 MODS_FORGEAPI_DOWNLOAD_DEPENDENCIES: "TRUE" # Contains mix of Forge and Fabric mods MODS_FORGEAPI_PROJECTIDS: 416089,419697