Set SDKMAN default version for stable releases only
Early Access / Default build (without GraalVM) (push) Has been cancelled
Early Access / Build with GraalVM on macos-15-arm64 (push) Has been cancelled
Early Access / Build with GraalVM on ubuntu-24.04-arm64 (push) Has been cancelled
Early Access / Build with GraalVM on windows-2025-arm64 (push) Has been cancelled
Early Access / Build with GraalVM on macos-15-x64 (push) Has been cancelled
Early Access / Build with GraalVM on macos-15-intel-x64 (push) Has been cancelled
Early Access / Build with GraalVM on ubuntu-24.04-x64 (push) Has been cancelled
Early Access / Build with GraalVM on windows-2025-x64 (push) Has been cancelled
Early Access / Site build (push) Has been cancelled
Stale / stale (push) Has been cancelled

Skip setting the default for pre-release versions (alpha, beta, rc,
snapshot, milestone) so that master can safely publish pre-releases
without changing the default away from the latest stable release.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Guillaume Nodet
2026-03-24 13:20:32 +01:00
parent f1b3e68005
commit c9d9fde3ed
+22 -19
View File
@@ -64,25 +64,28 @@ publishRelease ${VERSION} MAC_OSX darwin-amd64
publishRelease ${VERSION} MAC_ARM64 darwin-aarch64
publishRelease ${VERSION} WINDOWS_64 windows-amd64
# master produces "betas" still, that must NOT be set as default
# echo "Setting ${VERSION} as a default"
# RESPONSE="$(curl -s -X PUT \
# -H "Consumer-Key: ${SDKMAN_CONSUMER_KEY}" \
# -H "Consumer-Token: ${SDKMAN_CONSUMER_TOKEN}" \
# -H "Content-Type: application/json" \
# -H "Accept: application/json" \
# -d '{"candidate": "mvnd", "version": "'${VERSION}'"}' \
# https://vendors.sdkman.io/default)"
#
# node -pe "
# var json = JSON.parse(process.argv[1]);
# if (json.status == 202) {
# json.status + ' as expected from /default';
# } else {
# console.log('Unexpected status from /default: ' + process.argv[1]);
# process.exit(1);
# }
# " "${RESPONSE}"
if echo "${VERSION}" | grep -qiE '(alpha|beta|rc|snapshot|milestone)'; then
echo "Skipping setting ${VERSION} as default (pre-release version)"
else
echo "Setting ${VERSION} as a default"
RESPONSE="$(curl -s -X PUT \
-H "Consumer-Key: ${SDKMAN_CONSUMER_KEY}" \
-H "Consumer-Token: ${SDKMAN_CONSUMER_TOKEN}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"candidate": "mvnd", "version": "'${VERSION}'"}' \
https://vendors.sdkman.io/default)"
node -pe "
var json = JSON.parse(process.argv[1]);
if (json.status == 202) {
json.status + ' as expected from /default';
} else {
console.log('Unexpected status from /default: ' + process.argv[1]);
process.exit(1);
}
" "${RESPONSE}"
fi
RELEASE_URL="https://dlcdn.apache.org/maven/mvnd/${VERSION}"
echo "RELEASE_URL = $RELEASE_URL"