mirror of
https://github.com/actions/setup-java.git
synced 2025-06-29 04:24:14 +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
|
@ -8,7 +8,8 @@ import semver from 'semver';
|
|||
import {
|
||||
extractJdkFile,
|
||||
getDownloadArchiveExtension,
|
||||
isVersionSatisfies
|
||||
isVersionSatisfies,
|
||||
renameWinArchive
|
||||
} from '../../util';
|
||||
import * as core from '@actions/core';
|
||||
import * as tc from '@actions/tool-cache';
|
||||
|
@ -98,11 +99,13 @@ export class SemeruDistribution 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: string = await extractJdkFile(
|
||||
javaArchivePath,
|
||||
extension
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue