mirror of
https://github.com/actions/setup-java.git
synced 2025-04-21 02:16:45 +00:00
Quick fix for 32-bit architecture support.
This commit is contained in:
parent
5c87b70ffe
commit
8b062ac0cf
2 changed files with 33 additions and 9 deletions
21
dist/index.js
generated
vendored
21
dist/index.js
generated
vendored
|
@ -4696,7 +4696,7 @@ function getJava(version, arch, jdkFile, javaPackage) {
|
|||
}
|
||||
const contents = yield response.readBody();
|
||||
const refs = contents.match(/<a href.*\">/gi) || [];
|
||||
const downloadInfo = getDownloadInfo(refs, version, javaPackage);
|
||||
const downloadInfo = getDownloadInfo(refs, version, arch, javaPackage);
|
||||
jdkFile = yield tc.downloadTool(downloadInfo.url);
|
||||
version = downloadInfo.version;
|
||||
compressedFileExtension = IS_WINDOWS ? '.zip' : '.tar.gz';
|
||||
|
@ -4804,20 +4804,31 @@ function unzipJavaDownload(repoRoot, fileEnding, destinationFolder, extension) {
|
|||
}
|
||||
});
|
||||
}
|
||||
function getDownloadInfo(refs, version, javaPackage) {
|
||||
function getDownloadInfo(refs, version, arch, javaPackage) {
|
||||
version = normalizeVersion(version);
|
||||
let archExtension = '';
|
||||
if (arch === 'x86') {
|
||||
archExtension = 'i686';
|
||||
}
|
||||
else if (arch === 'x64') {
|
||||
archExtension = 'x64';
|
||||
}
|
||||
else {
|
||||
throw new Error(`architecture "${arch}" is not int [x86 | x64]`);
|
||||
}
|
||||
let extension = '';
|
||||
if (IS_WINDOWS) {
|
||||
extension = `-win_x64.zip`;
|
||||
extension = `-win_${archExtension}.zip`;
|
||||
}
|
||||
else {
|
||||
if (process.platform === 'darwin') {
|
||||
extension = `-macosx_x64.tar.gz`;
|
||||
extension = `-macosx_${archExtension}.tar.gz`;
|
||||
}
|
||||
else {
|
||||
extension = `-linux_x64.tar.gz`;
|
||||
extension = `-linux_${archExtension}.tar.gz`;
|
||||
}
|
||||
}
|
||||
core.debug(`Searching for files with extension: ${extension}`);
|
||||
let pkgRegexp = new RegExp('');
|
||||
let pkgTypeLength = 0;
|
||||
if (javaPackage === 'jdk') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue