File tree Expand file tree Collapse file tree 4 files changed +15
-6
lines changed
Expand file tree Collapse file tree 4 files changed +15
-6
lines changed Original file line number Diff line number Diff line change 1919- uses : actions/checkout@latest
2020- uses : actions/setup-java@v1
2121 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)
2323 architecture : x64 // (x64 or x86) - defaults to x64
2424- run : java -cp java HelloWorldApp
2525` ` `
3030- uses : actions/checkout@master
3131- uses : actions/setup-java@v1
3232 with :
33- version : ' 4.0.0'
33+ java- version : ' 4.0.0'
3434 architecture : x64
3535 jdkFile : <path to jdkFile> // Optional - jdkFile to install java from. Useful for versions not supported by Azul
3636- run : java -cp java HelloWorldApp
5050 - name : Setup java
5151 uses : actions/setup-java@v1
5252 with :
53- version : ${{ matrix.java }}
53+ java- version : ${{ matrix.java }}
5454 architecture : x64
5555 - run : java -cp java HelloWorldApp
5656` ` `
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ name: 'Setup Java environment'
22description : ' Setup your runner with Java'
33author : ' GitHub'
44inputs :
5- version :
5+ java- version :
66 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)'
77 required : true
88 architecture :
@@ -12,6 +12,9 @@ inputs:
1212 jdkFile :
1313 description : ' Path to where the compressed JDK is located. The path could be in your source repository or a local path on the agent.'
1414 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'
1518runs :
1619 using : ' node12'
1720 main : ' lib/setup-java.js'
Original file line number Diff line number Diff line change @@ -21,7 +21,10 @@ const path = __importStar(require("path"));
2121function run ( ) {
2222 return __awaiter ( this , void 0 , void 0 , function * ( ) {
2323 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+ }
2528 const arch = core . getInput ( 'architecture' , { required : true } ) ;
2629 const jdkFile = core . getInput ( 'jdkFile' , { required : false } ) || '' ;
2730 yield installer . getJava ( version , arch , jdkFile ) ;
Original file line number Diff line number Diff line change @@ -4,7 +4,10 @@ import * as path from 'path';
44
55async function run ( ) {
66 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+ }
811 const arch = core . getInput ( 'architecture' , { required : true } ) ;
912 const jdkFile = core . getInput ( 'jdkFile' , { required : false } ) || '' ;
1013
You can’t perform that action at this time.
0 commit comments