mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2026-01-04 17:17:23 +08:00
[macos] use unxip if available for XCode unpacking (#7992)
This commit is contained in:
@@ -166,3 +166,12 @@ function Get-Architecture {
|
||||
|
||||
return $arch
|
||||
}
|
||||
|
||||
function Test-CommandExists {
|
||||
param
|
||||
(
|
||||
[Parameter(Mandatory)] [string] $Command
|
||||
)
|
||||
|
||||
[boolean] (Get-Command $Command -ErrorAction 'SilentlyContinue')
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
Import-Module "$PSScriptRoot/Common.Helpers.psm1"
|
||||
Import-Module "$PSScriptRoot/Xcode.Helpers.psm1"
|
||||
|
||||
function Install-XcodeVersion {
|
||||
@@ -86,7 +87,11 @@ function Expand-XcodeXipArchive {
|
||||
|
||||
Write-Host "Extracting Xcode from '$xcodeXipPath'"
|
||||
Push-Location $DownloadDirectory
|
||||
Invoke-ValidateCommand "xip -x $xcodeXipPath"
|
||||
if(Test-CommandExists 'unxip') {
|
||||
Invoke-ValidateCommand "unxip $xcodeXipPath"
|
||||
} else {
|
||||
Invoke-ValidateCommand "xip -x $xcodeXipPath"
|
||||
}
|
||||
Pop-Location
|
||||
|
||||
if (Test-Path "$DownloadDirectory/Xcode-beta.app") {
|
||||
|
||||
@@ -202,7 +202,8 @@
|
||||
"tcl-tk",
|
||||
"r",
|
||||
"yq",
|
||||
"imagemagick"
|
||||
"imagemagick",
|
||||
"unxip"
|
||||
],
|
||||
"cask_packages": [
|
||||
"julia",
|
||||
|
||||
@@ -74,7 +74,8 @@
|
||||
"zstd",
|
||||
"gmp",
|
||||
"r",
|
||||
"yq"
|
||||
"yq",
|
||||
"unxip"
|
||||
],
|
||||
"cask_packages": [
|
||||
"julia",
|
||||
|
||||
Reference in New Issue
Block a user