Skip to content

Commit

Permalink
Fix SDKMAN publish from master (#1097)
Browse files Browse the repository at this point in the history
mvnd on master still produces "betas" (as long as mvn
master does), and it must not be set as "default" version
in SDKMAN. Defaults are still coming from mvnd-1.x branch.
  • Loading branch information
cstamas authored Aug 14, 2024
1 parent e49bf87 commit c5ad1ab
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions build/publish-on-sdkman.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,24 +63,25 @@ publishRelease ${VERSION} MAC_OSX darwin-amd64
publishRelease ${VERSION} MAC_ARM64 darwin-aarch64
publishRelease ${VERSION} WINDOWS_64 windows-amd64

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}"
# 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}"

RELEASE_URL="https://downloads.apache.org/maven/mvnd/${VERSION}"
echo "RELEASE_URL = $RELEASE_URL"
Expand Down

0 comments on commit c5ad1ab

Please sign in to comment.