forked from oracle-actions/setup-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
70 lines (66 loc) · 2.15 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: 'Setup Java Development Kits built by Oracle'
description: 'Download and set up a JDK built by Oracle'
branding:
icon: 'download-cloud'
color: 'red'
inputs:
website:
description: 'Site to download JDK from: `oracle.com` or `jdk.java.net`'
required: true
default: 'oracle.com'
release:
description: 'Feature release number or project name, defaults to `21`'
required: true
default: '21'
version:
description: 'Additional version information, defaults to `latest`'
required: true
default: 'latest'
install:
description: 'Install the downloaded JDK archive file by running actions/setup-java, defaults to `true`'
required: true
default: 'true'
install-as-version:
description:
Controls which value is passed as `java-version` to actions/setup-java, defaults to `PARSE_URI`
if `release` starts with a digit, else it defaults to `HASH_URI`
required: false
uri:
description: 'URI of JDK archive file to download'
required: false
outputs:
archive:
description: 'The path to the downloaded JDK archive file'
value: ${{ steps.download.outputs.archive }}
version:
description: 'The version of the downloaded JDK'
value: ${{ steps.download.outputs.version }}
runs:
using: 'composite'
steps:
- name: 'Download Java Development Kit'
id: download
shell: bash
run: |
JAVA=$JAVA_HOME_17_X64/bin/java
DOWNLOAD=$GITHUB_ACTION_PATH/src/Download.java
if [ ! -z "${{ inputs.uri }}" ]; then
$JAVA \
-Dinstall-as-version="${{ inputs.install-as-version }}" \
$DOWNLOAD \
${{ inputs.uri }}
else
$JAVA \
-Dinstall-as-version="${{ inputs.install-as-version }}" \
$DOWNLOAD \
${{ inputs.website }} \
${{ inputs.release }} \
${{ inputs.version }}
fi
- name: 'Install Java Development Kit'
if: ${{ inputs.install == 'true' }}
uses: actions/setup-java@v3
with:
java-version: ${{ steps.download.outputs.version }}
distribution: jdkfile
jdkFile: ${{ steps.download.outputs.archive }}