mirror of
https://github.com/julia-actions/setup-julia.git
synced 2026-02-22 07:56:54 +08:00
Use .tar.gz files where available for faster win install (#171)
This commit is contained in:
20
lib/installer.js
generated
20
lib/installer.js
generated
@@ -126,9 +126,9 @@ function getDesiredFileExts() {
|
|||||||
let hasFileExt2;
|
let hasFileExt2;
|
||||||
let fileExt2;
|
let fileExt2;
|
||||||
if (osPlat == 'win32') {
|
if (osPlat == 'win32') {
|
||||||
fileExt1 = 'exe';
|
fileExt1 = 'tar.gz';
|
||||||
hasFileExt2 = false;
|
hasFileExt2 = true;
|
||||||
fileExt2 = '';
|
fileExt2 = 'exe';
|
||||||
}
|
}
|
||||||
else if (osPlat == 'darwin') {
|
else if (osPlat == 'darwin') {
|
||||||
fileExt1 = 'tar.gz';
|
fileExt1 = 'tar.gz';
|
||||||
@@ -251,12 +251,18 @@ function installJulia(versionInfo, version, arch) {
|
|||||||
yield exec.exec('tar', ['xf', juliaDownloadPath, '--strip-components=1', '-C', tempInstallDir]);
|
yield exec.exec('tar', ['xf', juliaDownloadPath, '--strip-components=1', '-C', tempInstallDir]);
|
||||||
return tempInstallDir;
|
return tempInstallDir;
|
||||||
case 'win32':
|
case 'win32':
|
||||||
if (version.endsWith('nightly') || semver.gtr(version, '1.3', { includePrerelease: true })) {
|
if (fileInfo !== null && fileInfo.extension == 'exe') {
|
||||||
// The installer changed in 1.4: https://github.com/JuliaLang/julia/blob/ef0c9108b12f3ae177c51037934351ffa703b0b5/NEWS.md#build-system-changes
|
if (version.endsWith('nightly') || semver.gtr(version, '1.3', { includePrerelease: true })) {
|
||||||
yield exec.exec('powershell', ['-Command', `Start-Process -FilePath ${juliaDownloadPath} -ArgumentList "/SILENT /dir=${path.join(process.cwd(), tempInstallDir)}" -NoNewWindow -Wait`]);
|
// The installer changed in 1.4: https://github.com/JuliaLang/julia/blob/ef0c9108b12f3ae177c51037934351ffa703b0b5/NEWS.md#build-system-changes
|
||||||
|
yield exec.exec('powershell', ['-Command', `Start-Process -FilePath ${juliaDownloadPath} -ArgumentList "/SILENT /dir=${path.join(process.cwd(), tempInstallDir)}" -NoNewWindow -Wait`]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
yield exec.exec('powershell', ['-Command', `Start-Process -FilePath ${juliaDownloadPath} -ArgumentList "/S /D=${path.join(process.cwd(), tempInstallDir)}" -NoNewWindow -Wait`]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
yield exec.exec('powershell', ['-Command', `Start-Process -FilePath ${juliaDownloadPath} -ArgumentList "/S /D=${path.join(process.cwd(), tempInstallDir)}" -NoNewWindow -Wait`]);
|
// This is the more common path. Using .tar.gz is much faster
|
||||||
|
yield exec.exec('powershell', ['-Command', `tar xf ${juliaDownloadPath} --strip-components=1 -C ${tempInstallDir}`]);
|
||||||
}
|
}
|
||||||
return tempInstallDir;
|
return tempInstallDir;
|
||||||
case 'darwin':
|
case 'darwin':
|
||||||
|
|||||||
@@ -100,9 +100,9 @@ function getDesiredFileExts(): [string, boolean, string] {
|
|||||||
let fileExt2: string
|
let fileExt2: string
|
||||||
|
|
||||||
if (osPlat == 'win32') {
|
if (osPlat == 'win32') {
|
||||||
fileExt1 = 'exe'
|
fileExt1 = 'tar.gz'
|
||||||
hasFileExt2 = false
|
hasFileExt2 = true
|
||||||
fileExt2 = ''
|
fileExt2 = 'exe'
|
||||||
} else if (osPlat == 'darwin') {
|
} else if (osPlat == 'darwin') {
|
||||||
fileExt1 = 'tar.gz'
|
fileExt1 = 'tar.gz'
|
||||||
hasFileExt2 = true
|
hasFileExt2 = true
|
||||||
@@ -235,11 +235,16 @@ export async function installJulia(versionInfo, version: string, arch: string):
|
|||||||
await exec.exec('tar', ['xf', juliaDownloadPath, '--strip-components=1', '-C', tempInstallDir])
|
await exec.exec('tar', ['xf', juliaDownloadPath, '--strip-components=1', '-C', tempInstallDir])
|
||||||
return tempInstallDir
|
return tempInstallDir
|
||||||
case 'win32':
|
case 'win32':
|
||||||
if (version.endsWith('nightly') || semver.gtr(version, '1.3', {includePrerelease: true})) {
|
if (fileInfo !== null && fileInfo.extension == 'exe') {
|
||||||
// The installer changed in 1.4: https://github.com/JuliaLang/julia/blob/ef0c9108b12f3ae177c51037934351ffa703b0b5/NEWS.md#build-system-changes
|
if (version.endsWith('nightly') || semver.gtr(version, '1.3', {includePrerelease: true})) {
|
||||||
await exec.exec('powershell', ['-Command', `Start-Process -FilePath ${juliaDownloadPath} -ArgumentList "/SILENT /dir=${path.join(process.cwd(), tempInstallDir)}" -NoNewWindow -Wait`])
|
// The installer changed in 1.4: https://github.com/JuliaLang/julia/blob/ef0c9108b12f3ae177c51037934351ffa703b0b5/NEWS.md#build-system-changes
|
||||||
|
await exec.exec('powershell', ['-Command', `Start-Process -FilePath ${juliaDownloadPath} -ArgumentList "/SILENT /dir=${path.join(process.cwd(), tempInstallDir)}" -NoNewWindow -Wait`])
|
||||||
|
} else {
|
||||||
|
await exec.exec('powershell', ['-Command', `Start-Process -FilePath ${juliaDownloadPath} -ArgumentList "/S /D=${path.join(process.cwd(), tempInstallDir)}" -NoNewWindow -Wait`])
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
await exec.exec('powershell', ['-Command', `Start-Process -FilePath ${juliaDownloadPath} -ArgumentList "/S /D=${path.join(process.cwd(), tempInstallDir)}" -NoNewWindow -Wait`])
|
// This is the more common path. Using .tar.gz is much faster
|
||||||
|
await exec.exec('powershell', ['-Command', `tar xf ${juliaDownloadPath} --strip-components=1 -C ${tempInstallDir}`])
|
||||||
}
|
}
|
||||||
return tempInstallDir
|
return tempInstallDir
|
||||||
case 'darwin':
|
case 'darwin':
|
||||||
|
|||||||
Reference in New Issue
Block a user