mirror of
https://github.com/actions/runner-images.git
synced 2026-01-06 18:19:54 +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
|
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"
|
Import-Module "$PSScriptRoot/Xcode.Helpers.psm1"
|
||||||
|
|
||||||
function Install-XcodeVersion {
|
function Install-XcodeVersion {
|
||||||
@@ -86,7 +87,11 @@ function Expand-XcodeXipArchive {
|
|||||||
|
|
||||||
Write-Host "Extracting Xcode from '$xcodeXipPath'"
|
Write-Host "Extracting Xcode from '$xcodeXipPath'"
|
||||||
Push-Location $DownloadDirectory
|
Push-Location $DownloadDirectory
|
||||||
Invoke-ValidateCommand "xip -x $xcodeXipPath"
|
if(Test-CommandExists 'unxip') {
|
||||||
|
Invoke-ValidateCommand "unxip $xcodeXipPath"
|
||||||
|
} else {
|
||||||
|
Invoke-ValidateCommand "xip -x $xcodeXipPath"
|
||||||
|
}
|
||||||
Pop-Location
|
Pop-Location
|
||||||
|
|
||||||
if (Test-Path "$DownloadDirectory/Xcode-beta.app") {
|
if (Test-Path "$DownloadDirectory/Xcode-beta.app") {
|
||||||
|
|||||||
@@ -202,7 +202,8 @@
|
|||||||
"tcl-tk",
|
"tcl-tk",
|
||||||
"r",
|
"r",
|
||||||
"yq",
|
"yq",
|
||||||
"imagemagick"
|
"imagemagick",
|
||||||
|
"unxip"
|
||||||
],
|
],
|
||||||
"cask_packages": [
|
"cask_packages": [
|
||||||
"julia",
|
"julia",
|
||||||
|
|||||||
@@ -74,7 +74,8 @@
|
|||||||
"zstd",
|
"zstd",
|
||||||
"gmp",
|
"gmp",
|
||||||
"r",
|
"r",
|
||||||
"yq"
|
"yq",
|
||||||
|
"unxip"
|
||||||
],
|
],
|
||||||
"cask_packages": [
|
"cask_packages": [
|
||||||
"julia",
|
"julia",
|
||||||
|
|||||||
Reference in New Issue
Block a user