Publish new versions via sdkman vendor API
@@ -218,4 +218,48 @@ jobs:
asset_name: mvnd-${{ env.VERSION }}-windows-amd64.zip
asset_content_type: application/zip
+ - name: Publish on sdkman.io
+ run: |
+ echo "Publishing version ${{ env.VERSION }} on sdkman.io"
+ curl -X POST \
+ -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": "${{ env.VERSION }}", "platform" : "LINUX_64", "url": "https://github.com/mvndaemon/mvnd/releases/download/${{ env.VERSION }}/mvnd-${{ env.VERSION }}-linux-amd64.zip"}' \
+ https://vendors.sdkman.io/release/version
+ curl -X POST \
+ -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": "${{ env.VERSION }}", "platform" : "MAC_OSX", "url": "https://github.com/mvndaemon/mvnd/releases/download/${{ env.VERSION }}/mvnd-${{ env.VERSION }}-darwin-amd64.zip"}' \
+ https://vendors.sdkman.io/release/version
+ curl -X POST \
+ -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": "${{ env.VERSION }}", "platform" : "WINDOWS_64", "url": "https://github.com/mvndaemon/mvnd/releases/download/${{ env.VERSION }}/mvnd-${{ env.VERSION }}-windows-amd64.zip"}' \
+ https://vendors.sdkman.io/release/version
+
+ echo "Setting ${{ env.VERSION }} as a default on sdkman.io"
+ curl -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": "${{ env.VERSION }}"}' \
+ https://vendors.sdkman.io/default
+
+ RELEASE_URL=`curl -i https://git.io -F url=https://github.com/mvndaemon/mvnd/releases/tag/${{ env.VERSION }} | grep Location | sed -e 's/Location: //g' | tr -d '\n' | tr -d '\r'`
+ echo "RELEASE_URL = $RELEASE_URL"
+
+ curl --trace-ascii curl.trace -X POST \
+ -H "Consumer-Key: ${SDKMAN_CONSUMER_KEY}" \
+ -H "Consumer-Token: ${SDKMAN_CONSUMER_TOKEN}" \
+ -H "Content-Type: application/json" \
+ -H "Accept: application/json" \
+ -d '{"text": "mvnd ${{ env.VERSION }} released '${RELEASE_URL}'"}' \
+ https://vendors.sdkman.io/announce/freeform
