Skip to content

Commit 647bf39

Browse files
shamil-mubarakshingithub-actions[bot]459680Actions service accounterik-bershel
authored
Sync changes to macos-new-folder-structure branch (#8765)
* New folder structure * Update packer templates * Update refs in scripts * Updating readme file for macOS-12 version 20231029.1 (#8695) Co-authored-by: Image generation service account <no-reply@microsoft.com> Co-authored-by: Actions service account <no-reply@github.com> * [Windows] Remove Android SDK Patch applier v4 (#8750) * remove ndk 23 from macos images (#8747) * [Mac OS] Remove 'LTS' suffix from OpenJDK version (#8751) * [windows] split docker install into 3 scripts (#8688) * [windows] split docker install into 3 scripts the idea is to end with 1 script per 1 component for better observability * Update images/win/scripts/Installers/Install-Docker-Compose.ps1 Co-authored-by: Erik Bershel <110455084+erik-bershel@users.noreply.github.com> * Update images/win/scripts/Installers/Install-Docker-WinCred.ps1 Co-authored-by: Vasilii Polikarpov <126792224+vpolikarpov-akvelon@users.noreply.github.com> * fix test --------- Co-authored-by: Erik Bershel <110455084+erik-bershel@users.noreply.github.com> Co-authored-by: Vasilii Polikarpov <126792224+vpolikarpov-akvelon@users.noreply.github.com> * remove ndk 23 from ubuntu images (#8745) * [macos] add android SDK to SW report on Ventura ARM64 (#8715) * Fix utils path in templates * Sync changes * [Mac OS] Update Anka Helpers to build Mac OS 14 ARM image (#8757) * Update Anka Helpers to build Mac OS 14 ARM image * Drop Powershell 5 support * [Mac OS] Add missing macOS Sonoma selector (#8759) * remove ndk23 from windows images (#8746) * Updating readme file for macos-13 version 20231025.2 (#8672) Co-authored-by: Image generation service account <no-reply@microsoft.com> * Fix macOS-12.anka template with assets path --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Image generation service account <no-reply@microsoft.com> Co-authored-by: Actions service account <no-reply@github.com> Co-authored-by: Erik Bershel <110455084+erik-bershel@users.noreply.github.com> Co-authored-by: sergei-pyshnoi <121864472+sergei-pyshnoi@users.noreply.github.com> Co-authored-by: Vasilii Polikarpov <126792224+vpolikarpov-akvelon@users.noreply.github.com> Co-authored-by: ilia-shipitsin <125650415+ilia-shipitsin@users.noreply.github.com>
1 parent 10bf39e commit 647bf39

20 files changed

+203
-173
lines changed

images.CI/macos/anka/Service.Helpers.psm1

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -63,24 +63,24 @@ function Get-AvailableIPSWVersions {
6363
)
6464

6565
if ($IsBeta) {
66-
$command = { mist list firmware "$MacOSCodeNameOrVersion" --include-betas --latest --export "/Applications/export.json"}
66+
$command = { mist list firmware "$MacOSCodeNameOrVersion" --compatible --include-betas --latest --export "/Applications/export.json" }
6767
} elseif ($IsLatest) {
68-
$command = { mist list firmware "$MacOSCodeNameOrVersion" --latest --export "/Applications/export.json" }
68+
$command = { mist list firmware "$MacOSCodeNameOrVersion" --compatible --latest --export "/Applications/export.json" }
6969
} else {
70-
$command = { mist list firmware "$MacOSCodeNameOrVersion" --export "/Applications/export.json" }
70+
$command = { mist list firmware "$MacOSCodeNameOrVersion" --compatible --export "/Applications/export.json" }
7171
}
7272

7373
$condition = { $LASTEXITCODE -eq 0 }
7474
Invoke-WithRetry -Command $command -BreakCondition $condition | Out-Null
7575
$softwareList = get-content -Path "/Applications/export.json"
76-
$turgetVersion = ($softwareList | ConvertFrom-Json).version
77-
if ($null -eq $turgetVersion) {
76+
$availableBuilds = ($softwareList | ConvertFrom-Json).build
77+
if ($null -eq $availableBuilds) {
7878
Write-Host "Requested macOS '$MacOSCodeNameOrVersion' version not found in the list of available installers."
7979
$command = { mist list firmware "$($MacOSCodeNameOrVersion.split('.')[0])" }
8080
Invoke-WithRetry -Command $command -BreakCondition $condition
8181
exit 1
8282
}
83-
return $turgetVersion
83+
return $availableBuilds
8484
}
8585

8686
function Get-MacOSIPSWInstaller {
@@ -96,21 +96,26 @@ function Get-MacOSIPSWInstaller {
9696
$MacOSName = "macOS Monterey"
9797
} elseif ($MacOSVersion -eq [version] "13.0") {
9898
$MacOSName = "macOS Ventura"
99+
} elseif ($MacOSVersion -eq [version] "14.0") {
100+
$MacOSName = "macOS Sonoma"
99101
} else {
100102
$MacOSName = $MacOSVersion.ToString()
101103
}
102104

103-
104105
Write-Host "`t[*] Finding available full installers"
105106
if ($DownloadLatestVersion -eq $true) {
106-
$targetVersion = Get-AvailableIPSWVersions -IsLatest $true -MacOSCodeNameOrVersion $MacOSName
107-
Write-host "`t[*] The 'DownloadLatestVersion' flag is set to true. Latest macOS version is '$MacOSName' - '$targetVersion' now"
107+
$targetBuild = Get-AvailableIPSWVersions -IsLatest $true -MacOSCodeNameOrVersion $MacOSName
108+
Write-Host "`t[*] The 'DownloadLatestVersion' flag is set to true. Latest compatible macOS build of '$MacOSName' is '$targetBuild'"
108109
} elseif ($BetaSearch -eq $true) {
109-
$targetVersion = Get-AvailableIPSWVersions -IsBeta $true -MacOSCodeNameOrVersion $MacOSName
110-
Write-host "`t[*] The 'BetaSearch' flag is set to true. Latestbeta macOS version is '$MacOSName' - '$targetVersion' now"
110+
$targetBuild = Get-AvailableIPSWVersions -IsBeta $true -MacOSCodeNameOrVersion $MacOSName
111+
Write-Host "`t[*] The 'BetaSearch' flag is set to true. Latest compatible beta macOS build of '$MacOSName' is '$targetBuild'"
111112
} else {
112-
$targetVersion = Get-AvailableIPSWVersions -MacOSCodeNameOrVersion $MacOSName -IsLatest $false
113-
Write-host "`t[*] The exact version was specified - '$MacOSName' "
113+
$targetBuild = Get-AvailableIPSWVersions -MacOSCodeNameOrVersion $MacOSName -IsLatest $false
114+
Write-Host "`t[*] Available compatible macOS builds of '$MacOSName' are: $($targetBuild -join ', ')"
115+
if ($targetBuild.Count -gt 1) {
116+
Write-Error "`t[*] Please specify the exact build number of macOS you want to install"
117+
exit 1
118+
}
114119
}
115120

116121
$installerPathPattern = "/Applications/Install ${macOSName}*.ipsw"
@@ -123,12 +128,12 @@ function Get-MacOSIPSWInstaller {
123128
# Download macOS installer
124129
$installerDir = "/Applications/"
125130
$installerName = "Install ${macOSName}.ipsw"
126-
Write-Host "`t[*] Requested macOS '$targetVersion' version installer found, fetching it from mist database"
127-
Invoke-WithRetry { mist download firmware "$targetVersion" --output-directory $installerDir --firmware-name "$installerName" } {$LASTEXITCODE -eq 0} | Out-Null
131+
Write-Host "`t[*] Requested macOS '$targetBuild' version installer found, fetching it from mist database"
132+
Invoke-WithRetry { mist download firmware "$targetBuild" --output-directory $installerDir --firmware-name "$installerName" } { $LASTEXITCODE -eq 0 } | Out-Null
128133
if (Test-Path "$installerDir$installerName") {
129134
$result = "$installerDir$installerName"
130135
} else {
131-
Write-host "`t[*] Requested macOS '$targetVersion' version installer failed to download"
136+
Write-Error "`t[*] Requested macOS '$targetBuild' version installer failed to download"
132137
exit 1
133138
}
134139
return $result
@@ -169,7 +174,7 @@ function Get-MacOSInstaller {
169174
exit 1
170175
}
171176
Show-StringWithFormat $filteredVersions
172-
$osVersions = $filteredVersions.OSVersion | Sort-Object {[version]$_}
177+
$osVersions = $filteredVersions.OSVersion | Sort-Object { [version]$_ }
173178
$MacOSVersion = $osVersions | Select-Object -Last 1
174179
Write-Host "`t[*] The 'DownloadLatestVersion' flag is set. Latest macOS version is '$MacOSVersion' now"
175180
}
@@ -248,15 +253,15 @@ function Install-SoftwareUpdate {
248253
$command = "sw_vers"
249254
$guestMacosVersion = Invoke-SSHPassCommand -HostName $HostName -Command $command
250255
if ($guestMacosVersion[1] -match "12") {
251-
foreach ($update in $listOfUpdates){
256+
foreach ($update in $listOfUpdates) {
252257
# Filtering updates that contain "Ventura" word
253258
if ($update -notmatch "Ventura") {
254259
$command = "sudo /usr/sbin/softwareupdate --restart --verbose --install '$($update.trim())'"
255260
Invoke-SSHPassCommand -HostName $HostName -Command $command
256261
}
257262
}
258263
} elseif ($guestMacosVersion[1] -match "13") {
259-
foreach ($update in $listOfUpdates){
264+
foreach ($update in $listOfUpdates) {
260265
# Filtering updates that contain "Sonoma" word
261266
if ($update -notmatch "Sonoma") {
262267
$command = "sudo /usr/sbin/softwareupdate --restart --verbose --install '$($update.trim())'"
@@ -302,7 +307,11 @@ function Invoke-SSHPassCommand {
302307
"${env:SSHUSER}@${HostName}"
303308
)
304309
$sshPassOptions = $sshArg -join " "
305-
$result = bash -c "$sshPassOptions \""$Command\"" 2>&1"
310+
if ($PSVersionTable.PSVersion.Major -eq 7 -and $PSVersionTable.PSVersion.Minor -le 2) {
311+
$result = bash -c "$sshPassOptions \""$Command\"" 2>&1"
312+
} else {
313+
$result = bash -c "$sshPassOptions `"$Command`" 2>&1"
314+
}
306315
if ($LASTEXITCODE -ne 0) {
307316
Write-Error "There is an error during command execution:`n$result"
308317
exit 1

images/linux/scripts/tests/Android.Tests.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ Describe "Android" {
3333
# Convert 'm2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-beta1' ->
3434
# 'm2repository/com/android/support/constraint/constraint-layout-solver/1.0.0-beta1'
3535
# 'cmake;3.6.4111459' -> 'cmake/3.6.4111459'
36-
# 'patcher;v4' -> 'patcher/v4'
3736
$PackageName = $PackageName.Replace(";", "/")
3837
$targetPath = Join-Path $env:ANDROID_HOME $PackageName
3938
$targetPath | Should -Exist
@@ -65,4 +64,4 @@ Describe "Android" {
6564
Validate-AndroidPackage $PackageName
6665
}
6766
}
68-
}
67+
}

images/linux/toolsets/toolset-2004.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
"ndk": {
9898
"default": "25",
9999
"versions": [
100-
"23", "24", "25", "26"
100+
"24", "25", "26"
101101
]
102102
}
103103
},

images/linux/toolsets/toolset-2204.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
"ndk": {
9292
"default": "25",
9393
"versions": [
94-
"23", "24", "25", "26"
94+
"24", "25", "26"
9595
]
9696
}
9797
},

0 commit comments

Comments
 (0)