[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:
Erik Bershel
2024-09-20 16:06:10 +02:00
committed by GitHub
parent 8ffffdb49d
commit 6e8c37cf52
2 changed files with 8 additions and 6 deletions

View File

@@ -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:"

View File

@@ -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"