mirror of
https://github.com/actions/setup-java.git
synced 2025-04-20 01:46:46 +00:00
Fix Windows archives extraction issue (#689)
This commit is contained in:
parent
292cc14be8
commit
83a06ff9d9
15 changed files with 154 additions and 104 deletions
|
@ -13,7 +13,8 @@ import {
|
|||
import {
|
||||
extractJdkFile,
|
||||
getDownloadArchiveExtension,
|
||||
getGitHubHttpHeaders
|
||||
getGitHubHttpHeaders,
|
||||
renameWinArchive
|
||||
} from '../../util';
|
||||
import {HttpCodes} from '@actions/http-client';
|
||||
import {GraalVMEAVersion} from './models';
|
||||
|
@ -33,11 +34,13 @@ export class GraalVMDistribution extends JavaBase {
|
|||
core.info(
|
||||
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
||||
);
|
||||
const javaArchivePath = await tc.downloadTool(javaRelease.url);
|
||||
let javaArchivePath = await tc.downloadTool(javaRelease.url);
|
||||
|
||||
core.info(`Extracting Java archive...`);
|
||||
const extension = getDownloadArchiveExtension();
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
javaArchivePath = renameWinArchive(javaArchivePath);
|
||||
}
|
||||
const extractedJavaPath = await extractJdkFile(javaArchivePath, extension);
|
||||
|
||||
const archiveName = fs.readdirSync(extractedJavaPath)[0];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue