-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
action.yml
79 lines (74 loc) · 3.1 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
71
72
73
74
75
76
77
78
79
name: Setup Java
description: Automatic Java Setup
author: Fleshgrinder
branding:
color: black
icon: terminal
inputs:
# If not set defaults to `$JAVA_DEFAULT_VERSION`, if this does not exist it
# falls back to the value read from the `version-filename`.
version:
description: Specifies a version to use instead of reading it from a file, useful in matrix builds.
required: false
# If not set defaults to `$JAVA_DEFAULT_VERSION_FILENAME`, if this does not
# exist it falls back to `.java-version`.
version-filename:
description: Specifies the name to the file where the version should be read from.
required: false
# If not set defaults to `$JAVA_DEFAULT_DISTRIBUTION`, if this does not exist
# it falls back to `temurin`.
distribution:
description: Specifies the Java distribution (temurin, zulu, adopt, adopt-hotspot, adopt-openj9, liberica, microsoft, or corretto).
required: false
# If not set this defaults to `$JAVA_DEFAULT_ARCHITECTURE`, if this does not
# exist it falls back to mapping the `$RUNNER_ARCH`.
architecture:
description: Specifies the Java architecture (x86, x64, armv7, aarch64, or ppc64le).
required: false
# If not set this defaults to `$JAVA_DEFAULT_PACKAGE_TYPE`, if this does not
# exist it falls back to `jdk`.
package-type:
description: Specifies the Java package type (jdk, jre, jdk+fx, or jre+fx).
required: false
# If not set this defaults to `$JAVA_DEFAULT_CHECK_LATEST`, if this does not
# exist it falls back to `false`.
check-latest:
description: Specifies if the latest available version should be resolved on each run, or not.
required: false
outputs:
version:
description: Actual version of Java that has been set up.
value: ${{ steps.setup.outputs.version }}
distribution:
description: Identifier of the distribution that has been set up.
value: ${{ steps.setup.outputs.distribution }}
path:
description: Path where Java has been set up (same as `$JAVA_HOME`).
value: ${{ steps.setup.outputs.path }}
cache-hit:
description: Boolean indicating if a match was found in the cache.
value: ${{ steps.setup.outputs.cache-hit }}
runs:
using: composite
steps:
- name: Resolve Java Architecture
id: arch
if: ${{ inputs.architecture == '' && env.JAVA_DEFAULT_ARCHITECTURE == '' }}
shell: bash
run: exec '${{ github.action_path }}src/resolve_arch.py'
- name: Resolve Java Version
id: version
env:
INPUT_VERSION: ${{ inputs.version }}
INPUT_VERSION_FILENAME: ${{ inputs.version-filename }}
shell: bash
run: exec '${{ github.action_path }}src/resolve_version.py'
- name: Setup Java
id: setup
uses: actions/setup-java@v3
with:
architecture: ${{ inputs.architecture || env.JAVA_DEFAULT_ARCHITECTURE || steps.arch.outputs.value }}
check-latest: ${{ inputs.check-latest || env.JAVA_DEFAULT_CHECK_LATEST || 'false' }}
distribution: ${{ inputs.distribution || env.JAVA_DEFAULT_DISTRIBUTION || 'temurin' }}
java-package: ${{ inputs.package || env.JAVA_DEFAULT_PACKAGE_TYPE || 'jdk' }}
java-version: ${{ env.JAVA_VERSION }}