GeezerVison is showing github.com — Use java-version (#14) · ifit/setup-java@4c8159c
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: README.md +3-3Lines changed: 3 additions & 3 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| 19 | 19 | - uses: actions/checkout@latest | 20 | 20 | - uses: actions/setup-java@v1 | 21 | 21 | with: | 22 | | - version: '9.0.4' // The JDK version to make available on the path. Takes a whole or semver Jdk version, or 1.x syntax (e.g. 1.8 => Jdk 8.x) | | 22 | + java-version: '9.0.4' // The JDK version to make available on the path. Takes a whole or semver Jdk version, or 1.x syntax (e.g. 1.8 => Jdk 8.x) | 23 | 23 | architecture: x64 // (x64 or x86) - defaults to x64 | 24 | 24 | - run: java -cp java HelloWorldApp | 25 | 25 | ``` | | 30 | 30 | - uses: actions/checkout@master | 31 | 31 | - uses: actions/setup-java@v1 | 32 | 32 | with: | 33 | | - version: '4.0.0' | | 33 | + java-version: '4.0.0' | 34 | 34 | architecture: x64 | 35 | 35 | jdkFile: <path to jdkFile> // Optional - jdkFile to install java from. Useful for versions not supported by Azul | 36 | 36 | - run: java -cp java HelloWorldApp | | 50 | 50 | - name: Setup java | 51 | 51 | uses: actions/setup-java@v1 | 52 | 52 | with: | 53 | | - version: ${{ matrix.java }} | | 53 | + java-version: ${{ matrix.java }} | 54 | 54 | architecture: x64 | 55 | 55 | - run: java -cp java HelloWorldApp | 56 | 56 | ``` | |
Collapse file Copy file name to clipboardExpand all lines: action.yml +4-1Lines changed: 4 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -2,7 +2,7 @@ name: 'Setup Java environment' | 2 | 2 | description: 'Setup your runner with Java' | 3 | 3 | author: 'GitHub' | 4 | 4 | inputs: | 5 | | - version: | | 5 | + java-version: | 6 | 6 | description: 'The JDK version to make available on the path. Takes a whole or semver Jdk version, or 1.x syntax (e.g. 1.8 => Jdk 8.x)' | 7 | 7 | required: true | 8 | 8 | architecture: | @@ -12,6 +12,9 @@ inputs: | 12 | 12 | jdkFile: | 13 | 13 | description: 'Path to where the compressed JDK is located. The path could be in your source repository or a local path on the agent.' | 14 | 14 | required: false | | 15 | +# Deprecated option, do not use. Will not be supported after October 1, 2019 | | 16 | + version: | | 17 | + description: 'Deprecated. Use java-version instead. Will not be supported after October 1, 2019' | 15 | 18 | runs: | 16 | 19 | using: 'node12' | 17 | 20 | main: 'lib/setup-java.js' |
Collapse file Copy file name to clipboardExpand all lines: lib/setup-java.js +4-1Lines changed: 4 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -21,7 +21,10 @@ const path = __importStar(require("path")); | 21 | 21 | function run() { | 22 | 22 | return __awaiter(this, void 0, void 0, function* () { | 23 | 23 | try { | 24 | | - const version = core.getInput('version', { required: true }); | | 24 | + let version = core.getInput('version'); | | 25 | + if (!version) { | | 26 | + version = core.getInput('java-version', { required: true }); | | 27 | + } | 25 | 28 | const arch = core.getInput('architecture', { required: true }); | 26 | 29 | const jdkFile = core.getInput('jdkFile', { required: false }) || ''; | 27 | 30 | yield installer.getJava(version, arch, jdkFile); | |
Collapse file Copy file name to clipboardExpand all lines: src/setup-java.ts +4-1Lines changed: 4 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -4,7 +4,10 @@ import * as path from 'path'; | 4 | 4 |
| 5 | 5 | async function run() { | 6 | 6 | try { | 7 | | - const version = core.getInput('version', {required: true}); | | 7 | + let version = core.getInput('version'); | | 8 | + if (!version) { | | 9 | + version = core.getInput('java-version', {required: true}); | | 10 | + } | 8 | 11 | const arch = core.getInput('architecture', {required: true}); | 9 | 12 | const jdkFile = core.getInput('jdkFile', {required: false}) || ''; | 10 | 13 |
| |
|