Skip to content

Commit e1ed525

Browse files
committed
Add reusable workflow for SDKMAN! release
1 parent 04ada79 commit e1ed525

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

.github/workflows/release-sdkman.yml

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
###################################################################################################
2+
### THIS IS A REUSABLE WORKFLOW TO PUBLISH SCALA TO SDKMAN! ###
3+
### HOW TO USE: ###
4+
### - THE RELEASE WORKFLOW SHOULD CALL THIS WORKFLOW ###
5+
### - IT WILL PUBLISH TO SDKMAN! THE BINARIES TO EACH SUPPORTED PLATFORM AND A UNIVERSAL JAR ###
6+
### - IT CHANGES THE DEFAULT VERSION IN SDKMAN! ###
7+
### ###
8+
### NOTE: ###
9+
### - WE SHOULD KEEP IN SYNC THE NAME OF THE ARCHIVES WITH THE ACTUAL BUILD ###
10+
### - WE SHOULD KEEP IN SYNC THE URL OF THE RELEASE ###
11+
###################################################################################################
12+
13+
14+
name: Release Scala to SDKMAN!
15+
run-name: Release Scala ${{ inputs.version }} to SDKMAN!
16+
17+
on:
18+
workflow_call:
19+
inputs:
20+
version:
21+
required: true
22+
type: string
23+
secrets:
24+
SDKMAN_KEY:
25+
required: true
26+
SDKMAN_TOKEN:
27+
required: true
28+
29+
env:
30+
RELEASE-URL: 'https://github.com/scala/scala3/releases/download/${{ inputs.version }}'
31+
32+
jobs:
33+
publish:
34+
runs-on: ubuntu-latest
35+
strategy:
36+
matrix:
37+
include:
38+
- platform: LINUX_64
39+
archive : 'scala3-${{ inputs.version }}-x86_64-pc-linux.tar.gz'
40+
- platform: LINUX_ARM64
41+
archive : 'scala3-${{ inputs.version }}-aarch64-pc-linux.tar.gz'
42+
- platform: MAC_OSX
43+
archive : 'scala3-${{ inputs.version }}-x86_64-apple-darwin.tar.gz'
44+
- platform: MAC_ARM64
45+
archive : 'scala3-${{ inputs.version }}-aarch64-apple-darwin.tar.gz'
46+
- platform: WINDOWS_64
47+
archive : 'scala3-${{ inputs.version }}-x86_64-pc-win32.tar.gz'
48+
- platform: UNIVERSAL
49+
archive : 'scala3-${{ inputs.version }}.zip'
50+
steps:
51+
- uses: hamzaremmal/sdkman-release-action@main # TODO: Make a release of the action and configure the version here
52+
with:
53+
CONSUMER-KEY : ${{ secrets.SDKMAN_KEY }}
54+
CONSUMER-TOKEN : ${{ secrets.SDKMAN_TOKEN }}
55+
CANDIDATE : 'scala'
56+
VERSION : ${{ inputs.version }}
57+
URL : '${{ env.RELEASE-URL }}/${{ matrix.archive }}'
58+
PLATFORM : ${{ matrix.platform }}
59+
60+
default:
61+
runs-on: ubuntu-latest
62+
needs: publish
63+
steps:
64+
- uses: hamzaremmal/sdkman-default-action@main # TODO: Make a release of the action and configure the version here
65+
with:
66+
CONSUMER-KEY : ${{ secrets.SDKMAN_KEY }}
67+
CONSUMER-TOKEN : ${{ secrets.SDKMAN_TOKEN }}
68+
CANDIDATE : 'scala'
69+
VERSION : ${{ inputs.version }}

0 commit comments

Comments
 (0)