mirror of
https://github.com/actions/setup-java.git
synced 2025-03-13 17:47:03 +00:00
Fix extracting Java from archive
This commit is contained in:
parent
1eb0ec886a
commit
221194fabc
2 changed files with 5 additions and 3 deletions
3
dist/setup/index.js
vendored
3
dist/setup/index.js
vendored
|
@ -38607,7 +38607,8 @@ class LibericaDistributions extends base_installer_1.JavaBase {
|
||||||
core.info(`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`);
|
core.info(`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`);
|
||||||
const javaArchivePath = yield tc.downloadTool(javaRelease.url);
|
const javaArchivePath = yield tc.downloadTool(javaRelease.url);
|
||||||
core.info(`Extracting Java archive...`);
|
core.info(`Extracting Java archive...`);
|
||||||
const extractedJavaPath = yield util_1.extractJdkFile(javaArchivePath);
|
const extension = util_1.getDownloadArchiveExtension();
|
||||||
|
const extractedJavaPath = yield util_1.extractJdkFile(javaArchivePath, extension);
|
||||||
const archiveName = fs_1.default.readdirSync(extractedJavaPath)[0];
|
const archiveName = fs_1.default.readdirSync(extractedJavaPath)[0];
|
||||||
const archivePath = path_1.default.join(extractedJavaPath, archiveName);
|
const archivePath = path_1.default.join(extractedJavaPath, archiveName);
|
||||||
const javaPath = yield tc.cacheDir(archivePath, this.toolcacheFolderName, this.getToolcacheVersionName(javaRelease.version), this.architecture);
|
const javaPath = yield tc.cacheDir(archivePath, this.toolcacheFolderName, this.getToolcacheVersionName(javaRelease.version), this.architecture);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { JavaBase } from '../base-installer';
|
import { JavaBase } from '../base-installer';
|
||||||
import { JavaDownloadRelease, JavaInstallerOptions, JavaInstallerResults } from '../base-models';
|
import { JavaDownloadRelease, JavaInstallerOptions, JavaInstallerResults } from '../base-models';
|
||||||
import semver from 'semver';
|
import semver from 'semver';
|
||||||
import { extractJdkFile, isVersionSatisfies } from '../../util';
|
import { extractJdkFile, getDownloadArchiveExtension, isVersionSatisfies } from '../../util';
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import { ArchitectureOptions, LibericaVersion, OsVersions } from './models';
|
import { ArchitectureOptions, LibericaVersion, OsVersions } from './models';
|
||||||
import * as tc from '@actions/tool-cache';
|
import * as tc from '@actions/tool-cache';
|
||||||
|
@ -24,7 +24,8 @@ export class LibericaDistributions extends JavaBase {
|
||||||
const javaArchivePath = await tc.downloadTool(javaRelease.url);
|
const javaArchivePath = await tc.downloadTool(javaRelease.url);
|
||||||
|
|
||||||
core.info(`Extracting Java archive...`);
|
core.info(`Extracting Java archive...`);
|
||||||
const extractedJavaPath = await extractJdkFile(javaArchivePath);
|
const extension = getDownloadArchiveExtension();
|
||||||
|
const extractedJavaPath = await extractJdkFile(javaArchivePath, extension);
|
||||||
|
|
||||||
const archiveName = fs.readdirSync(extractedJavaPath)[0];
|
const archiveName = fs.readdirSync(extractedJavaPath)[0];
|
||||||
const archivePath = path.join(extractedJavaPath, archiveName);
|
const archivePath = path.join(extractedJavaPath, archiveName);
|
||||||
|
|
Loading…
Add table
Reference in a new issue