From c76c555e9872fe558c4ecadb6ac9074fe5a20bc0 Mon Sep 17 00:00:00 2001 From: Marco Vermeulen Date: Fri, 21 Mar 2025 15:44:56 +0000 Subject: [PATCH 01/10] Add GitHub Actions documentation to Vendors page - Add SDKMAN\! Release Action documentation with usage examples - Add SDKMAN\! Default Action documentation with usage examples - Include combined workflow example showing both actions together Co-Authored-By: Claude --- docs/vendors.mdx | 157 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 139 insertions(+), 18 deletions(-) diff --git a/docs/vendors.mdx b/docs/vendors.mdx index 966ff8a..33dc28e 100644 --- a/docs/vendors.mdx +++ b/docs/vendors.mdx @@ -128,28 +128,149 @@ curl -X PUT \ https://vendors.sdkman.io/default ``` -### Broadcast a Structured Message +## GitHub Actions -This will result in a structured message announcement on social media and -SDKMAN! CLI. The result will look something like: -`grails 3.0.0 available for download. https://git.io/release`. The url can point -to the github release page or the version's changelog. This message will be -announced to the broadcast channel of SDKMAN! CLI, as well as on the -[@sdkman\_](https://x.com/sdkman_) X feed. +If you're using GitHub Actions for your CI/CD pipeline, SDKMAN! provides official GitHub Actions that can help you automate the release process. -```shell -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", "url": "https://git.io/release"}' \ -https://vendors.sdkman.io/announce/struct +### SDKMAN! Release Action + +The [SDKMAN! Release Action](https://github.com/sdkman/sdkman-release-action) allows you to release a new version of your candidate to SDKMAN! directly from your GitHub workflow. + +#### Features + +- Release a new version of your SDK to SDKMAN! +- Support for multi-platform binaries +- Support for multi-vendor candidates +- Support for checksums + +#### Basic Usage + +```yaml +name: Release to SDKMAN! + +on: + release: + types: [published] + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Release to SDKMAN! + uses: sdkman/sdkman-release-action@v2 + with: + consumer_key: ${{ secrets.SDKMAN_CONSUMER_KEY }} + consumer_token: ${{ secrets.SDKMAN_CONSUMER_TOKEN }} + candidate: myCandidateName + version: ${{ github.event.release.tag_name }} + url: https://github.com/myorg/myrepo/releases/download/${{ github.event.release.tag_name }}/mycandidatename-${{ github.event.release.tag_name }}.zip +``` + +#### Advanced Usage + +For multi-platform releases or when adding checksums: + +```yaml +name: Release Java to SDKMAN! + +on: + workflow_dispatch: + inputs: + version: + description: 'Version to release' + required: true + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Release Linux x64 to SDKMAN! + uses: sdkman/sdkman-release-action@v2 + with: + consumer_key: ${{ secrets.SDKMAN_CONSUMER_KEY }} + consumer_token: ${{ secrets.SDKMAN_CONSUMER_TOKEN }} + candidate: java + version: ${{ github.event.inputs.version }} + vendor: acme + url: https://github.com/acme/java/releases/download/${{ github.event.inputs.version }}/java-linux-x64.tar.gz + platform: LINUX_64 + checksums: | + { + "SHA-256": "abcd1234...", + "SHA-512": "efgh5678..." + } +``` + +### SDKMAN! Default Action + +The [SDKMAN! Default Action](https://github.com/sdkman/sdkman-default-action) allows you to set an existing version as the default for a candidate on SDKMAN!. + +#### Features + +- Set an existing version as the default for a candidate +- Makes a previously released version the default version that users get when installing without specifying a version + +#### Basic Usage + +```yaml +name: Set Default on SDKMAN! + +on: + workflow_dispatch: + inputs: + version: + description: 'Version to set as default' + required: true + +jobs: + set-default: + runs-on: ubuntu-latest + steps: + - name: Set Default on SDKMAN! + uses: sdkman/sdkman-default-action@v1 + with: + consumer_key: ${{ secrets.SDKMAN_CONSUMER_KEY }} + consumer_token: ${{ secrets.SDKMAN_CONSUMER_TOKEN }} + candidate: myCandidateName + version: ${{ github.event.inputs.version }} +``` + +#### Combined Workflow Example + +When you want to release a new version and set it as default in one workflow: + +```yaml +name: Release and Set Default on SDKMAN! + +on: + release: + types: [published] + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Release to SDKMAN! + uses: sdkman/sdkman-release-action@v2 + with: + consumer_key: ${{ secrets.SDKMAN_CONSUMER_KEY }} + consumer_token: ${{ secrets.SDKMAN_CONSUMER_TOKEN }} + candidate: myCandidateName + version: ${{ github.event.release.tag_name }} + url: https://github.com/myorg/myrepo/releases/download/${{ github.event.release.tag_name }}/mycandidatename-${{ github.event.release.tag_name }}.zip + + - name: Set as Default on SDKMAN! + uses: sdkman/sdkman-default-action@v1 + with: + consumer_key: ${{ secrets.SDKMAN_CONSUMER_KEY }} + consumer_token: ${{ secrets.SDKMAN_CONSUMER_TOKEN }} + candidate: myCandidateName + version: ${{ github.event.release.tag_name }} ``` ## Gradle SDK Vendor Plugin -If fiddling with cURL (or HttpClient) isn’t your thing, you could consider using +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: @@ -168,7 +289,7 @@ for the project. ## Maven SDK Vendor Plugin -If fiddling with cURL (or HttpClient) or Gradle isn’t your thing, you could +If fiddling with cURL (or HttpClient) or Gradle isn't your thing, you could consider using our Maven plugin. The plugin allows the release to be done as a side effect of your CI build! It exposes several useful goals like: @@ -183,4 +304,4 @@ It also exposes some convenience goals that roll the above into single goals: For more details of about this plugin, as well as how to configure it, please refer to the [Github Page](https://github.com/sdkman/sdkman-vendor-maven-plugin) -for the project. +for the project. \ No newline at end of file From 7d5ad94a5acf2087f6d5b4c9be48780ab14f36c1 Mon Sep 17 00:00:00 2001 From: Marco Vermeulen Date: Fri, 21 Mar 2025 15:48:30 +0000 Subject: [PATCH 02/10] Restore Broadcast a Structured Message section Co-Authored-By: Claude --- docs/vendors.mdx | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/docs/vendors.mdx b/docs/vendors.mdx index 33dc28e..a4c529d 100644 --- a/docs/vendors.mdx +++ b/docs/vendors.mdx @@ -304,4 +304,23 @@ It also exposes some convenience goals that roll the above into single goals: For more details of about this plugin, as well as how to configure it, please refer to the [Github Page](https://github.com/sdkman/sdkman-vendor-maven-plugin) -for the project. \ No newline at end of file +for the project. + +## 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 available for download. https://git.io/release`. The url can point +to the github release page or the version's changelog. This message will be +announced to the broadcast channel of SDKMAN! CLI, as well as on the +[@sdkman\_](https://x.com/sdkman_) X feed. + +```shell +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", "url": "https://git.io/release"}' \ +https://vendors.sdkman.io/announce/struct +``` \ No newline at end of file From d52f4c087c3518e194460b391b6e9ee96fe230bc Mon Sep 17 00:00:00 2001 From: Marco Vermeulen Date: Fri, 21 Mar 2025 16:34:09 +0000 Subject: [PATCH 03/10] Update release action version to v1 Co-authored-by: Hamza Remmal --- docs/vendors.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/vendors.mdx b/docs/vendors.mdx index a4c529d..db2ee0a 100644 --- a/docs/vendors.mdx +++ b/docs/vendors.mdx @@ -157,7 +157,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Release to SDKMAN! - uses: sdkman/sdkman-release-action@v2 + uses: sdkman/sdkman-release-action@v1 with: consumer_key: ${{ secrets.SDKMAN_CONSUMER_KEY }} consumer_token: ${{ secrets.SDKMAN_CONSUMER_TOKEN }} From 8fd5f0e3370d79cbda4dc55af66769c911bc66d0 Mon Sep 17 00:00:00 2001 From: Marco Vermeulen Date: Fri, 21 Mar 2025 16:35:22 +0000 Subject: [PATCH 04/10] Update release action example checksums. Co-authored-by: Hamza Remmal --- docs/vendors.mdx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/docs/vendors.mdx b/docs/vendors.mdx index db2ee0a..9d5dfc0 100644 --- a/docs/vendors.mdx +++ b/docs/vendors.mdx @@ -194,11 +194,8 @@ jobs: vendor: acme url: https://github.com/acme/java/releases/download/${{ github.event.inputs.version }}/java-linux-x64.tar.gz platform: LINUX_64 - checksums: | - { - "SHA-256": "abcd1234...", - "SHA-512": "efgh5678..." - } + CHECKSUM-SHA-256: "abcd1234..." + CHECKSUM-SHA-512: "efgh5678..." ``` ### SDKMAN! Default Action From 35c1c1b97b5938e9148bd368a0ff6df9326397f3 Mon Sep 17 00:00:00 2001 From: Marco Vermeulen Date: Fri, 21 Mar 2025 16:37:02 +0000 Subject: [PATCH 05/10] Further updates to release example. Co-authored-by: Hamza Remmal --- docs/vendors.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/vendors.mdx b/docs/vendors.mdx index 9d5dfc0..47d2c71 100644 --- a/docs/vendors.mdx +++ b/docs/vendors.mdx @@ -226,8 +226,8 @@ jobs: - name: Set Default on SDKMAN! uses: sdkman/sdkman-default-action@v1 with: - consumer_key: ${{ secrets.SDKMAN_CONSUMER_KEY }} - consumer_token: ${{ secrets.SDKMAN_CONSUMER_TOKEN }} + consumer-key: ${{ secrets.SDKMAN_CONSUMER_KEY }} + consumer-token: ${{ secrets.SDKMAN_CONSUMER_TOKEN }} candidate: myCandidateName version: ${{ github.event.inputs.version }} ``` From 37cf895b6b1832c23ede6067a8078afa9f85a821 Mon Sep 17 00:00:00 2001 From: Marco Vermeulen Date: Fri, 21 Mar 2025 16:37:15 +0000 Subject: [PATCH 06/10] Further updates Co-authored-by: Hamza Remmal --- docs/vendors.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/vendors.mdx b/docs/vendors.mdx index 47d2c71..051d3ec 100644 --- a/docs/vendors.mdx +++ b/docs/vendors.mdx @@ -250,8 +250,8 @@ jobs: - name: Release to SDKMAN! uses: sdkman/sdkman-release-action@v2 with: - consumer_key: ${{ secrets.SDKMAN_CONSUMER_KEY }} - consumer_token: ${{ secrets.SDKMAN_CONSUMER_TOKEN }} + consumer-key: ${{ secrets.SDKMAN_CONSUMER_KEY }} + consumer-token: ${{ secrets.SDKMAN_CONSUMER_TOKEN }} candidate: myCandidateName version: ${{ github.event.release.tag_name }} url: https://github.com/myorg/myrepo/releases/download/${{ github.event.release.tag_name }}/mycandidatename-${{ github.event.release.tag_name }}.zip From 6ea682f4d6031175da7bba1c88d8ed884e446a0c Mon Sep 17 00:00:00 2001 From: Marco Vermeulen Date: Fri, 21 Mar 2025 16:37:30 +0000 Subject: [PATCH 07/10] Update docs/vendors.mdx Co-authored-by: Hamza Remmal --- docs/vendors.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/vendors.mdx b/docs/vendors.mdx index 051d3ec..d4afabe 100644 --- a/docs/vendors.mdx +++ b/docs/vendors.mdx @@ -259,8 +259,8 @@ jobs: - name: Set as Default on SDKMAN! uses: sdkman/sdkman-default-action@v1 with: - consumer_key: ${{ secrets.SDKMAN_CONSUMER_KEY }} - consumer_token: ${{ secrets.SDKMAN_CONSUMER_TOKEN }} + consumer-key: ${{ secrets.SDKMAN_CONSUMER_KEY }} + consumer-token: ${{ secrets.SDKMAN_CONSUMER_TOKEN }} candidate: myCandidateName version: ${{ github.event.release.tag_name }} ``` From 6da1d347066334f76eede07767adcc01377b7cd3 Mon Sep 17 00:00:00 2001 From: Marco Vermeulen Date: Fri, 21 Mar 2025 16:37:43 +0000 Subject: [PATCH 08/10] Update docs/vendors.mdx Co-authored-by: Hamza Remmal --- docs/vendors.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/vendors.mdx b/docs/vendors.mdx index d4afabe..2561c72 100644 --- a/docs/vendors.mdx +++ b/docs/vendors.mdx @@ -187,8 +187,8 @@ jobs: - name: Release Linux x64 to SDKMAN! uses: sdkman/sdkman-release-action@v2 with: - consumer_key: ${{ secrets.SDKMAN_CONSUMER_KEY }} - consumer_token: ${{ secrets.SDKMAN_CONSUMER_TOKEN }} + consumer-key: ${{ secrets.SDKMAN_CONSUMER_KEY }} + consumer-token: ${{ secrets.SDKMAN_CONSUMER_TOKEN }} candidate: java version: ${{ github.event.inputs.version }} vendor: acme From c58a4239ac43c5273f94a01a8cf4be72f8a19028 Mon Sep 17 00:00:00 2001 From: Marco Vermeulen Date: Fri, 21 Mar 2025 16:49:08 +0000 Subject: [PATCH 09/10] Remove vendor attribute from release action example The release action does not yet support the vendor attribute. Co-Authored-By: Claude --- docs/vendors.mdx | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/vendors.mdx b/docs/vendors.mdx index 2561c72..9917fa9 100644 --- a/docs/vendors.mdx +++ b/docs/vendors.mdx @@ -191,7 +191,6 @@ jobs: consumer-token: ${{ secrets.SDKMAN_CONSUMER_TOKEN }} candidate: java version: ${{ github.event.inputs.version }} - vendor: acme url: https://github.com/acme/java/releases/download/${{ github.event.inputs.version }}/java-linux-x64.tar.gz platform: LINUX_64 CHECKSUM-SHA-256: "abcd1234..." From f6a8d322ba5c2c6b8a35773f4321c9dd394dc468 Mon Sep 17 00:00:00 2001 From: Marco Vermeulen Date: Mon, 28 Apr 2025 21:40:36 +0100 Subject: [PATCH 10/10] fix: fix uppercase params for GH actions --- docs/vendors.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/vendors.mdx b/docs/vendors.mdx index 9917fa9..a2e7cb8 100644 --- a/docs/vendors.mdx +++ b/docs/vendors.mdx @@ -193,8 +193,8 @@ jobs: version: ${{ github.event.inputs.version }} url: https://github.com/acme/java/releases/download/${{ github.event.inputs.version }}/java-linux-x64.tar.gz platform: LINUX_64 - CHECKSUM-SHA-256: "abcd1234..." - CHECKSUM-SHA-512: "efgh5678..." + checksum-md5: "abcd1234..." + checksum-sha-512: "efgh5678..." ``` ### SDKMAN! Default Action @@ -319,4 +319,4 @@ curl -X POST \ -H "Accept: application/json" \ -d '{"candidate": "grails", "version": "3.0.0", "url": "https://git.io/release"}' \ https://vendors.sdkman.io/announce/struct -``` \ No newline at end of file +```