mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-15 06:19:21 +00:00
[macOS] Update base image generation to work with Sequoia updates (#10651)
Co-authored-by: sarathrajsrinivasan <159180023+sarathrajsrinivasan@users.noreply.github.com>
This commit is contained in:
@@ -93,8 +93,9 @@ function Invoke-SoftwareUpdate {
|
||||
$command = "sw_vers"
|
||||
$guestMacosVersion = Invoke-SSHPassCommand -HostName $ipAddress -Command $command
|
||||
switch -regex ($guestMacosVersion[1]) {
|
||||
'12.\d' { $nextOSVersion = 'macOS Ventura|macOS Sonoma' }
|
||||
'13.\d' { $nextOSVersion = 'macOS Sonoma' }
|
||||
'12.\d' { $nextOSVersion = 'macOS Ventura|macOS Sonoma|macOS Sequoia' }
|
||||
'13.\d' { $nextOSVersion = 'macOS Sonoma|macOS Sequoia' }
|
||||
'14.\d' { $nextOSVersion = 'macOS Sequoia' }
|
||||
}
|
||||
|
||||
Write-Host "`t[*] Fetching Software Updates ready to install on '$TemplateName' VM:"
|
||||
|
||||
@@ -39,14 +39,15 @@ function Invoke-SoftwareUpdateArm64 {
|
||||
$command = "sw_vers"
|
||||
$guestMacosVersion = Invoke-SSHPassCommand -HostName $HostName -Command $command
|
||||
switch -regex ($guestMacosVersion[1]) {
|
||||
'13.\d' { $nextOSVersion = 'Sonoma' }
|
||||
'14.\d' { $nextOSVersion = 'NotYetDefined' }
|
||||
'12.\d' { $nextOSVersion = 'macOS Ventura|macOS Sonoma|macOS Sequoia' }
|
||||
'13.\d' { $nextOSVersion = 'macOS Sonoma|macOS Sequoia' }
|
||||
'14.\d' { $nextOSVersion = 'macOS Sequoia' }
|
||||
}
|
||||
|
||||
$url = "https://raw.githubusercontent.com/actions/runner-images/main/images/macos/assets/auto-software-update-arm64.exp"
|
||||
$script = Invoke-RestMethod -Uri $url
|
||||
foreach ($update in $listOfUpdates) {
|
||||
if ($update -notmatch "$nextOSVersion") {
|
||||
foreach ($update in $ListOfUpdates) {
|
||||
if ($update -notmatch $nextOSVersion) {
|
||||
$updatedScript = $script.Replace("MACOSUPDATE", $($($update.trim()).Replace(" ","\ ")))
|
||||
$base64 = [Convert]::ToBase64String($updatedScript.ToCharArray())
|
||||
$command = "echo $base64 | base64 --decode > ./auto-software-update-arm64.exp;chmod +x ./auto-software-update-arm64.exp; ./auto-software-update-arm64.exp ${Password};rm ./auto-software-update-arm64.exp"
|
||||
|
||||
Reference in New Issue
Block a user