add custom jdk url
This commit is contained in:
parent
ebb356cc4e
commit
d5ddf8cf5e
17
dist/setup/index.js
vendored
17
dist/setup/index.js
vendored
@ -128794,8 +128794,21 @@ class JavaBase {
|
||||
else {
|
||||
core.info('Trying to resolve the latest version from remote');
|
||||
try {
|
||||
const javaRelease = yield this.findPackageForDownload(this.version);
|
||||
core.info(`Resolved latest version as ${javaRelease.version}`);
|
||||
const javaRelease = { version: this.version };
|
||||
const jdkUrl = core.getInput('jdk-url');
|
||||
if (jdkUrl) {
|
||||
if (!this.version) {
|
||||
throw new Error('You must specify a version when using a custom JDK URL.');
|
||||
}
|
||||
core.info(`Using custom JDK URL: ${jdkUrl}`);
|
||||
javaRelease.url = jdkUrl;
|
||||
}
|
||||
else {
|
||||
const jdkPkg = yield this.findPackageForDownload(this.version);
|
||||
core.info(`Resolved latest version as ${javaRelease.version}`);
|
||||
javaRelease.version = jdkPkg.version;
|
||||
javaRelease.url = jdkPkg.url;
|
||||
}
|
||||
if ((foundJava === null || foundJava === void 0 ? void 0 : foundJava.version) === javaRelease.version) {
|
||||
core.info(`Resolved Java ${foundJava.version} from tool-cache`);
|
||||
}
|
||||
|
||||
@ -52,8 +52,22 @@ export abstract class JavaBase {
|
||||
} else {
|
||||
core.info('Trying to resolve the latest version from remote');
|
||||
try {
|
||||
const javaRelease = await this.findPackageForDownload(this.version);
|
||||
core.info(`Resolved latest version as ${javaRelease.version}`);
|
||||
const javaRelease = { version: this.version } as JavaDownloadRelease;
|
||||
const jdkUrl = core.getInput('jdk-url');
|
||||
if (jdkUrl) {
|
||||
if (!this.version) {
|
||||
throw new Error(
|
||||
'You must specify a version when using a custom JDK URL.'
|
||||
);
|
||||
}
|
||||
core.info(`Using custom JDK URL: ${jdkUrl}`);
|
||||
javaRelease.url = jdkUrl;
|
||||
} else {
|
||||
const jdkPkg = await this.findPackageForDownload(this.version)
|
||||
core.info(`Resolved latest version as ${javaRelease.version}`);
|
||||
javaRelease.version = jdkPkg.version;
|
||||
javaRelease.url = jdkPkg.url;
|
||||
}
|
||||
if (foundJava?.version === javaRelease.version) {
|
||||
core.info(`Resolved Java ${foundJava.version} from tool-cache`);
|
||||
} else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user