mirror of
https://github.com/actions/runner-images.git
synced 2025-12-19 08:22:12 +00:00
[macos] download XCode installer with retries (#7898)
This commit is contained in:
@@ -11,7 +11,7 @@ function Install-XcodeVersion {
|
|||||||
$xcodeDownloadDirectory = "$env:HOME/Library/Caches/XcodeInstall"
|
$xcodeDownloadDirectory = "$env:HOME/Library/Caches/XcodeInstall"
|
||||||
$xcodeTargetPath = Get-XcodeRootPath -Version $LinkTo
|
$xcodeTargetPath = Get-XcodeRootPath -Version $LinkTo
|
||||||
$xcodeXipDirectory = Invoke-DownloadXcodeArchive -DownloadDirectory $xcodeDownloadDirectory -Version $Version
|
$xcodeXipDirectory = Invoke-DownloadXcodeArchive -DownloadDirectory $xcodeDownloadDirectory -Version $Version
|
||||||
Expand-XcodeXipArchive -DownloadDirectory $xcodeXipDirectory -TargetPath $xcodeTargetPath
|
Expand-XcodeXipArchive -DownloadDirectory $xcodeXipDirectory.FullName -TargetPath $xcodeTargetPath
|
||||||
|
|
||||||
Remove-Item -Path $xcodeXipDirectory -Force -Recurse
|
Remove-Item -Path $xcodeXipDirectory -Force -Recurse
|
||||||
}
|
}
|
||||||
@@ -31,8 +31,7 @@ function Invoke-DownloadXcodeArchive {
|
|||||||
$xcodeFileName = 'Xcode-{0}.xip' -f $Version
|
$xcodeFileName = 'Xcode-{0}.xip' -f $Version
|
||||||
$xcodeUri = '{0}{1}{2}'-f ${env:XCODE_INSTALL_STORAGE_URL}, $xcodeFileName, ${env:XCODE_INSTALL_SAS}
|
$xcodeUri = '{0}{1}{2}'-f ${env:XCODE_INSTALL_STORAGE_URL}, $xcodeFileName, ${env:XCODE_INSTALL_SAS}
|
||||||
|
|
||||||
Invoke-WebRequest -Uri $xcodeUri -OutFile (Join-Path $tempXipDirectory $xcodeFileName)
|
Start-DownloadWithRetry -Url $xcodeUri -DownloadPath $tempXipDirectory.FullName -Name $xcodeFileName
|
||||||
|
|
||||||
return $tempXipDirectory
|
return $tempXipDirectory
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user