Skip to content

Commit 3255345

Browse files
committed
Add get-supported-jdks action
1 parent 22de893 commit 3255345

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Get supported JDKs
2+
description: Get supported JDKs
3+
inputs:
4+
HZ_VERSION:
5+
description: HZ Version
6+
required: true
7+
outputs:
8+
jdks:
9+
value: ${{ steps.get-supported-jdks.outputs.jdks }}
10+
description: Returns supported JDKs
11+
runs:
12+
using: "composite"
13+
steps:
14+
- shell: bash
15+
id: get-supported-jdks
16+
run: |
17+
. .github/scripts/version.functions.sh
18+
HZ_VERSION="${{ inputs.HZ_VERSION }}"
19+
if version_less_than "$HZ_VERSION" "5.4.0"; then
20+
echo "jdks=['11', '17']" >> $GITHUB_OUTPUT
21+
else
22+
echo "jdks=['17', '21']" >> $GITHUB_OUTPUT
23+
fi

.github/scripts/version.functions.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ function version_less_or_equal() {
2828
[ "$1" = "$(echo -e "$1\n$2" | sort -V | head -n1)" ]
2929
}
3030

31+
function version_less_than() {
32+
[ "$1" != "$2" ] && version_less_or_equal "$1" "$2"
33+
}
34+
3135
function get_tags_descending() {
3236
git tag -l "v*" | sort -V -r | grep -v '-'
3337
}

0 commit comments

Comments
 (0)