Fork me on GitHub

Vendors

SDKMAN! is unique in that it empowers SDK Vendors to publish their own Candidate releases on our platform. We provide a secure API that can be used to manage all aspects of a release on SDKMAN!. This includes Releasing a new Version, setting an existing Version as Default (Stable) and Announcing the release on the SDKMAN! CLI broadcast and Twitter feed.

Operations

The API is a simple JSON REST API that allows several operations:

  • Release a new Candidate Version
  • Make a Version the Default for a given Candidate
  • Broadcast a structured release message
  • Broadcast a freeform message

Access

This is a secured API, and requires appropriate credentials to perform the above operations. Access will be granted on a case-by-case basis to Vendors who are interested in making their technology available on SDKMAN!. If you want to publish your releases on SDKMAN!, please contact Marco Vermeulen to help getting you on board.

Endpoints

The simplest way to call the API is by using cURL. Of course, any other client can be used to perform the API operations:

Release a new Candidate Version

This will perform a Minor Release on SDKMAN!. It will simply add the new Candidate Version, but will not make it the default version for the Candidate.

curl -X POST \
    -H "consumer_key: CONSUMER_KEY" \
    -H "consumer_token: CONSUMER_TOKEN" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"candidate": "groovy", "version": "2.4.2", "url": "http://dl.bintray.com/groovy/maven/groovy-binary-2.4.2.zip"}' \
    https://vendors.sdkman.io/release
                                        


Set existing Version as Default for Candidate

When calling this endpoint for an existing Candidate Version, it will make it the Default Version for that Candidate. This makes a Minor release a Major release!

curl -X PUT \
    -H "consumer_key: CONSUMER_KEY" \
    -H "consumer_token: CONSUMER_TOKEN" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"candidate": "groovy", "default": "2.3.8"}' \
    https://vendors.sdkman.io/default
                                        


Broadcast a Structured Message

This will result in a structured message announcement on social media and SDKMAN! CLI. The result will look something like: Grails 3.0.0 has been released on SDKMAN! #grailsfw. This message will be announced to the broadcast channel of SDKMAN! CLI, as well as on the @sdkman_ Twitter feed.

curl -X POST \
    -H "consumer_key: CONSUMER_KEY" \
    -H "consumer_token: CONSUMER_TOKEN" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"candidate": "grails", "version": "3.0.0", "hashtag": "grailsfw"}' \
    https://vendors.sdkman.io/announce/struct
                                        


Broadcast a Freeform Message

This endpoint is not used as much as the previous, but allows freeform messages to be announced.

curl -X POST \
    -H "consumer_key: CONSUMER_KEY" \
    -H "consumer_token: CONSUMER_TOKEN" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"text": "SDKMAN! 2.4.0 rolling out. Broadcast and Offline checks optimised."}' \
    https://vendors.sdkman.io/announce/freeform
                                        


Gradle SDK Vendor Plugin

If fiddling with cURL (or HttpClient) isn’t your thing, you could consider using our Gradle plugin. The plugin allows the release to be done as a side effect of your CI build! It exposes several useful tasks like:

  • gvmReleaseVersion
  • gvmDefaultVersion
  • gvmAnnounceVersion
It also exposes some convenience tasks that roll the above into single tasks:
  • sdkMajorRelease: performs release, default and structured announce
  • sdkMinorRelease: performs release and structured announce, no default
For more details of about this plugin, as well as how to configure it, please refer to the Github Page for the project.