[macOS] Introduce macOS-15 code (#10535)

Co-authored-by: Alexey-Ayupov <alexey-ayupov@github.com>
This commit is contained in:
Erik Bershel
2024-09-03 18:45:06 +02:00
committed by GitHub
parent ff516bd145
commit ab15087979
30 changed files with 897 additions and 89 deletions

View File

@@ -19,11 +19,12 @@ fi
# Put documentation to $HOME root
cp $HOME/image-generation/output/software-report/systeminfo.* $HOME/
# Put build vm assets scripts to proper directory
# Put build vm assets (xamarin-selector) scripts to proper directory
if is_Monterey || is_Sonoma || is_Ventura; then
mkdir -p /usr/local/opt/$USER/scripts
mv $HOME/image-generation/assets/* /usr/local/opt/$USER/scripts
find /usr/local/opt/$USER/scripts -type f -name "*\.sh" -exec chmod +x {} \;
fi
# Remove fastlane cached cookie
rm -rf ~/.fastlane

View File

@@ -32,7 +32,7 @@ systemValuesArray=(
"'kTCCServiceSystemPolicyNetworkVolumes','com.apple.Terminal',0,2,4,1,X'fade0c000000003000000001000000060000000200000012636f6d2e6170706c652e5465726d696e616c000000000003',NULL,0,'UNUSED',NULL,0,1678990068"
)
for values in "${systemValuesArray[@]}"; do
if is_Sonoma; then
if is_Sonoma || is_Sequoia; then
# TCC access table in Sonoma has extra 4 columns: pid, pid_version, boot_uuid, last_reminded
configure_system_tccdb "$values,NULL,NULL,'UNUSED',${values##*,}"
else
@@ -66,7 +66,7 @@ userValuesArray=(
"'kTCCServiceAppleEvents','/usr/local/opt/runner/provisioner/provisioner',1,2,3,1,NULL,NULL,0,'com.apple.systemevents',X'fade0c000000003400000001000000060000000200000016636f6d2e6170706c652e73797374656d6576656e7473000000000003',NULL,1592919552"
)
for values in "${userValuesArray[@]}"; do
if is_Sonoma; then
if is_Sonoma || is_Sequoia; then
# TCC access table in Sonoma has extra 4 columns: pid, pid_version, boot_uuid, last_reminded
configure_user_tccdb "$values,NULL,NULL,'UNUSED',${values##*,}"
else

View File

@@ -6,6 +6,11 @@
source ~/utils/utils.sh
if is_Sequoia; then
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
fi
echo "Installing bicep cli..."
brew tap azure/bicep
brew_smart_install bicep

View File

@@ -38,32 +38,34 @@ $languageAndRuntime.AddToolVersion("Bash", $(Get-BashVersion))
$languageAndRuntime.AddNodes($(Get-ClangLLVMVersions))
$languageAndRuntime.AddNodes($(Get-GccVersions))
$languageAndRuntime.AddNodes($(Get-FortranVersions))
if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) {
if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) {
$languageAndRuntime.AddToolVersion("Julia", $(Get-JuliaVersion))
}
$languageAndRuntime.AddToolVersion("Kotlin", $(Get-KotlinVersion))
if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) {
if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) {
$languageAndRuntime.AddToolVersion("Go", $(Get-GoVersion))
}
if ((-not $os.IsSequoia)) {
$languageAndRuntime.AddToolVersion("Mono", $(Get-MonoVersion))
}
$languageAndRuntime.AddToolVersion("Node.js", $(Get-NodeVersion))
if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) {
if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) {
$languageAndRuntime.AddToolVersion("MSBuild", $(Get-MSBuildVersion))
$languageAndRuntime.AddToolVersion("NVM", $(Get-NVMVersion))
$languageAndRuntime.AddToolVersionsListInline("NVM - Cached node versions", $(Get-NVMNodeVersionList), '^\d+')
}
$languageAndRuntime.AddToolVersion("Perl", $(Get-PerlVersion))
if ((-not $os.IsVenturaArm64) -and (-not $os.IsSonomaArm64)) {
if ((-not $os.IsVenturaArm64) -and (-not $os.IsSonomaArm64) -and (-not $os.IsSequoiaArm64)) {
$languageAndRuntime.AddToolVersion("PHP", $(Get-PHPVersion))
}
if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) {
if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) {
$languageAndRuntime.AddToolVersion("Python", $(Get-PythonVersion))
}
$languageAndRuntime.AddToolVersion("Python3", $(Get-Python3Version))
if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) {
if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) {
$languageAndRuntime.AddToolVersion("R", $(Get-RVersion))
}
@@ -74,16 +76,18 @@ $packageManagement = $installedSoftware.AddHeader("Package Management")
$packageManagement.AddToolVersion("Bundler", $(Get-BundlerVersion))
$packageManagement.AddToolVersion("Carthage", $(Get-CarthageVersion))
$packageManagement.AddToolVersion("CocoaPods", $(Get-CocoaPodsVersion))
if ((-not $os.IsVenturaArm64) -and (-not $os.IsSonomaArm64)) {
if ((-not $os.IsVenturaArm64) -and (-not $os.IsSonomaArm64) -and (-not $os.IsSequoiaArm64)) {
$packageManagement.AddToolVersion("Composer", $(Get-ComposerVersion))
}
$packageManagement.AddToolVersion("Homebrew", $(Get-HomebrewVersion))
if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) {
if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) {
$packageManagement.AddToolVersion("Miniconda", $(Get-CondaVersion))
}
$packageManagement.AddToolVersion("NPM", $(Get-NPMVersion))
if ((-not $os.IsSequoia)) {
$packageManagement.AddToolVersion("NuGet", $(Get-NuGetVersion))
if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) {
}
if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) {
$packageManagement.AddToolVersion("Pip", $(Get-PipVersion -Version 2))
}
@@ -91,12 +95,12 @@ $packageManagement.AddToolVersion("Pip3", $(Get-PipVersion -Version 3))
$packageManagement.AddToolVersion("Pipx", $(Get-PipxVersion))
$packageManagement.AddToolVersion("RubyGems", $(Get-RubyGemsVersion))
if ((-not $os.IsVenturaArm64) -and (-not $os.IsSonomaArm64) -and (-not $os.IsSonoma)) {
if ((-not $os.IsVenturaArm64) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) {
$packageManagement.AddToolVersion("Vcpkg", $(Get-VcpkgVersion))
}
$packageManagement.AddToolVersion("Yarn", $(Get-YarnVersion))
if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) {
if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) {
$packageManagement.AddNode($(Build-PackageManagementEnvironmentTable))
}
# Project Management
@@ -104,7 +108,7 @@ $projectManagement = $installedSoftware.AddHeader("Project Management")
$projectManagement.AddToolVersion("Apache Ant", $(Get-ApacheAntVersion))
$projectManagement.AddToolVersion("Apache Maven", $(Get-MavenVersion))
$projectManagement.AddToolVersion("Gradle", $(Get-GradleVersion))
if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) {
if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) {
$projectManagement.AddToolVersion("Sbt", $(Get-SbtVersion))
}
@@ -123,18 +127,18 @@ $utilities.AddToolVersion("GitHub CLI", $(Get-GitHubCLIVersion))
$utilities.AddToolVersion("GNU Tar", $(Get-GnuTarVersion))
$utilities.AddToolVersion("GNU Wget", $(Get-WgetVersion))
$utilities.AddToolVersion("gpg (GnuPG)", $(Get-GPGVersion))
if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) {
if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) {
$utilities.AddToolVersion("ImageMagick", $(Get-ImageMagickVersion))
}
$utilities.AddToolVersion("jq", $(Get-JqVersion))
if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) {
if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) {
$utilities.AddToolVersion("mongo", $(Get-MongoVersion))
$utilities.AddToolVersion("mongod", $(Get-MongodVersion))
}
$utilities.AddToolVersion("OpenSSL", $(Get-OpenSSLVersion))
$utilities.AddToolVersion("Packer", $(Get-PackerVersion))
$utilities.AddToolVersion("pkg-config", $(Get-PKGConfigVersion))
if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) {
if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) {
$utilities.AddToolVersion("PostgreSQL", $(Get-PostgresServerVersion))
$utilities.AddToolVersion("psql (PostgreSQL)", $(Get-PostgresClientVersion))
$utilities.AddToolVersion("Sox", $(Get-SoxVersion))
@@ -150,7 +154,7 @@ $utilities.AddToolVersion("zstd", $(Get-ZstdVersion))
# Tools
$tools = $installedSoftware.AddHeader("Tools")
if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) {
if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) {
$tools.AddToolVersion("App Center CLI", $(Get-AppCenterCLIVersion))
}
$tools.AddToolVersion("AWS CLI", $(Get-AWSCLIVersion))
@@ -159,7 +163,7 @@ $tools.AddToolVersion("AWS Session Manager CLI", $(Get-AWSSessionManagerCLIVersi
$tools.AddToolVersion("Azure CLI", $(Get-AzureCLIVersion))
$tools.AddToolVersion("Azure CLI (azure-devops)", $(Get-AzureDevopsVersion))
$tools.AddToolVersion("Bicep CLI", $(Get-BicepVersion))
if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) {
if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) {
$tools.AddToolVersion("Cabal", $(Get-CabalVersion))
}
$tools.AddToolVersion("Cmake", $(Get-CmakeVersion))
@@ -168,14 +172,14 @@ if ($os.IsMonterey) {
$tools.AddToolVersion("Colima", $(Get-ColimaVersion))
}
$tools.AddToolVersion("Fastlane", $(Get-FastlaneVersion))
if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) {
if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) {
$tools.AddToolVersion("GHC", $(Get-GHCVersion))
$tools.AddToolVersion("GHCup", $(Get-GHCupVersion))
$tools.AddToolVersion("Jazzy", $(Get-JazzyVersion))
$tools.AddToolVersion("Stack", $(Get-StackVersion))
}
$tools.AddToolVersion("SwiftFormat", $(Get-SwiftFormatVersion))
if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) {
if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) {
$tools.AddToolVersion("Swig", $(Get-SwigVersion))
}
$tools.AddToolVersion("Xcbeautify", $(Get-XcbeautifyVersion))
@@ -184,10 +188,10 @@ $tools.AddToolVersion("Xcodes", $(Get-XcodesVersion))
# Linters
$linters = $installedSoftware.AddHeader("Linters")
if ((-not $os.IsVenturaArm64) -and (-not $os.IsSonomaArm64)) {
if ((-not $os.IsVenturaArm64) -and (-not $os.IsSonomaArm64) -and (-not $os.IsSequoiaArm64)) {
$linters.AddToolVersion("SwiftLint", $(Get-SwiftLintVersion))
}
if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) {
if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) {
$linters.AddToolVersion("Yamllint", $(Get-YamllintVersion))
}
@@ -201,7 +205,6 @@ $java = $installedSoftware.AddHeader("Java")
$java.AddTable($(Get-JavaVersions))
# Toolcache
$toolcache = $installedSoftware.AddHeader("Cached Tools")
$toolcache.AddNodes($(Build-ToolcacheSection))
@@ -213,7 +216,7 @@ $rust.AddToolVersion("Rustdoc", $(Get-RustdocVersion))
$rust.AddToolVersion("Rustup", $(Get-RustupVersion))
$rustPackages = $rust.AddHeader("Packages")
if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) {
if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) {
$rustPackages.AddToolVersion("Bindgen", $(Get-Bindgen))
$rustPackages.AddToolVersion("Cargo-audit", $(Get-Cargoaudit))
$rustPackages.AddToolVersion("Cargo-outdated", $(Get-Cargooutdated))
@@ -230,13 +233,13 @@ $powerShellModules = $powerShell.AddHeader("PowerShell Modules")
$powerShellModules.AddNodes($(Get-PowerShellModules))
# Web Servers
if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) {
if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) {
$webServers = $installedSoftware.AddHeader("Web Servers")
$webServers.AddTable($(Build-WebServersSection))
}
# Xamarin section
if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) {
if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) {
$xamarin = $installedSoftware.AddHeader("Xamarin")
$vsForMac = $xamarin.AddHeader("Visual Studio for Mac")
$vsForMac.AddTable($(Build-VSMacTable))
@@ -263,7 +266,7 @@ Get-XcodeInfoList | Out-Null
$xcodeInfo = Get-XcodeInfoList
$xcode.AddTable($(Build-XcodeTable $xcodeInfo))
if ((-not $os.IsVentura) -and (-not $os.IsSonoma)) {
if ((-not $os.IsVentura) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) {
$xcodeTools = $xcode.AddHeader("Xcode Support Tools")
$xcodeTools.AddNodes($(Build-XcodeSupportToolsSection))
}
@@ -290,7 +293,7 @@ if ($os.IsMonterey) {
$miscellaneous.AddToolVersion("Zlib", $(Get-ZlibVersion))
}
if ($os.IsSonomaX64 -or $os.IsVenturaX64) {
if ($os.IsSonomaX64 -or $os.IsVenturaX64 -or $os.IsSequoiaX64) {
$miscellaneous = $installedSoftware.AddHeader("Miscellaneous")
}
if ($os.IsMonterey -or $os.IsSonomaX64 -or $os.IsVenturaX64) {

View File

@@ -11,7 +11,7 @@ function Build-BrowserSection {
[ToolVersionNode]::new("ChromeDriver", $(Get-ChromeDriverVersion))
)
if ((-not $os.IsVenturaArm64) -and (-not $os.IsSonomaArm64)) {
if ((-not $os.IsVenturaArm64) -and (-not $os.IsSonomaArm64) -and (-not $os.IsSequoiaArm64)) {
$nodes += @(
[ToolVersionNode]::new("Microsoft Edge", $(Get-EdgeVersion))
[ToolVersionNode]::new("Microsoft Edge WebDriver", $(Get-EdgeDriverVersion))
@@ -79,7 +79,7 @@ function Get-GeckodriverVersion {
function Get-SeleniumVersion {
$os = Get-OSVersion
if ($os.IsVenturaArm64 -or $os.IsSonomaArm64) {
if ($os.IsVenturaArm64 -or $os.IsSonomaArm64 -or $os.IsSequoiaArm64) {
$cellarPath = "/opt/homebrew/Cellar"
} else {
$cellarPath = "/usr/local/Cellar"

View File

@@ -2,7 +2,7 @@ function Get-JavaVersions {
$defaultJavaPath = (Get-Item env:JAVA_HOME).value
$os = Get-OSVersion
if ($os.IsVenturaArm64 -or $os.IsSonomaArm64) {
if ($os.IsVenturaArm64 -or $os.IsSonomaArm64 -or $os.IsSequoiaArm64) {
$javaVersions = Get-Item env:JAVA_HOME_*_arm64
} else {
$javaVersions = Get-Item env:JAVA_HOME_*_X64

View File

@@ -37,12 +37,12 @@ function Build-ToolcacheSection {
$nodes = @()
if ((-not $os.IsVenturaArm64) -and (-not $os.IsSonoma)) {
if ((-not $os.IsVenturaArm64) -and (-not $os.IsSonoma) -and (-not $os.IsSequoia)) {
$nodes += @(
[ToolVersionsListNode]::new("PyPy", $(Get-ToolcachePyPyVersions), '^\d+\.\d+', "List")
)
}
if ((-not $os.IsVenturaArm64) -and (-not $os.IsSonomaArm64)) {
if ((-not $os.IsVenturaArm64) -and (-not $os.IsSonomaArm64) -and (-not $os.IsSequoiaArm64)) {
$nodes += @(
[ToolVersionsListNode]::new("Ruby", $(Get-ToolcacheRubyVersions), '^\d+\.\d+', "List")
)

View File

@@ -36,6 +36,9 @@ function Get-OSVersion {
IsSonoma = $($osVersion.Version.Major -eq "14")
IsSonomaArm64 = $($osVersion.Version.Major -eq "14" -and $processorArchitecture -eq "arm64")
IsSonomaX64 = $($osVersion.Version.Major -eq "14" -and $processorArchitecture -ne "arm64")
IsSequoia = $($osVersion.Version.Major -eq "15")
IsSequoiaArm64 = $($osVersion.Version.Major -eq "15" -and $processorArchitecture -eq "arm64")
IsSequoiaX64 = $($osVersion.Version.Major -eq "15" -and $processorArchitecture -ne "arm64")
}
}

View File

@@ -45,6 +45,18 @@ is_Arm64() {
[ "$(arch)" = "arm64" ]
}
is_Sequoia() {
[ "$OSTYPE" = "darwin24" ]
}
is_SequoiaArm64() {
is_Sequoia && is_Arm64
}
is_SequoiaX64() {
is_Sequoia && ! is_Arm64
}
is_Sonoma() {
[ "$OSTYPE" = "darwin23" ]
}

View File

@@ -26,7 +26,7 @@ Describe "cmake" {
}
}
Describe "Subversion" -Skip:($os.IsVentura -or $os.IsSonoma) {
Describe "Subversion" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
It "Subversion" {
"svn --version" | Should -ReturnZeroExitCode
}
@@ -111,7 +111,7 @@ Describe "bazel" {
}
}
Describe "Julia" -Skip:($os.IsVentura -or $os.IsSonoma) {
Describe "Julia" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
It "Julia" {
"julia --version" | Should -ReturnZeroExitCode
}
@@ -135,19 +135,19 @@ Describe "wget" {
}
}
Describe "vagrant" -Skip:($os.IsVentura -or $os.IsSonoma) {
Describe "vagrant" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
It "vagrant" {
"vagrant --version" | Should -ReturnZeroExitCode
}
}
Describe "virtualbox" -Skip:($os.IsVentura -or $os.IsSonoma) {
Describe "virtualbox" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
It "virtualbox" {
"vboxmanage -v" | Should -ReturnZeroExitCode
}
}
Describe "R" -Skip:($os.IsVentura -or $os.IsSonoma) {
Describe "R" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
It "R" {
"R --version" | Should -ReturnZeroExitCode
}
@@ -167,7 +167,7 @@ Describe "Kotlin" {
}
}
Describe "sbt" -Skip:($os.IsVentura -or $os.IsSonoma) {
Describe "sbt" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
It "sbt" {
"sbt -version" | Should -ReturnZeroExitCode
}
@@ -179,7 +179,7 @@ Describe "yq" {
}
}
Describe "imagemagick" -Skip:($os.IsVentura -or $os.IsSonoma) {
Describe "imagemagick" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
It "imagemagick" {
"magick -version" | Should -ReturnZeroExitCode
}

View File

@@ -41,7 +41,7 @@ Describe "Selenium server" {
}
}
Describe "Edge" -Skip:($os.IsVenturaArm64 -or $os.IsSonomaArm64) {
Describe "Edge" -Skip:($os.IsVenturaArm64 -or $os.IsSonomaArm64 -or $os.IsSequoiaArm64) {
It "Microsoft Edge" {
$edgeLocation = "/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge"
$edgeLocation | Should -Exist
@@ -53,7 +53,7 @@ Describe "Edge" -Skip:($os.IsVenturaArm64 -or $os.IsSonomaArm64) {
}
}
Describe "Firefox" -Skip:($os.IsVenturaArm64 -or $os.IsSonomaArm64) {
Describe "Firefox" -Skip:($os.IsVenturaArm64 -or $os.IsSonomaArm64 -or $os.IsSequoiaArm64) {
It "Firefox" {
$firefoxLocation = "/Applications/Firefox.app/Contents/MacOS/firefox"
$firefoxLocation | Should -Exist

View File

@@ -33,7 +33,7 @@ Describe "GCC" {
}
}
Describe "vcpkg" -Skip:($os.IsVenturaArm64 -or $os.IsSonomaArm64 -or $os.IsSonoma) {
Describe "vcpkg" -Skip:($os.IsVenturaArm64 -or $os.IsSonoma -or $os.IsSequoia) {
It "vcpkg" {
"vcpkg version" | Should -ReturnZeroExitCode
}
@@ -58,7 +58,7 @@ Describe "AzCopy" {
}
}
Describe "Miniconda" -Skip:($os.IsVentura -or $os.IsSonoma) {
Describe "Miniconda" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
It "Conda" {
[System.Environment]::GetEnvironmentVariable("CONDA") | Should -Not -BeNullOrEmpty
$condaBinPath = Join-Path $env:CONDA "bin" "conda"
@@ -66,7 +66,7 @@ Describe "Miniconda" -Skip:($os.IsVentura -or $os.IsSonoma) {
}
}
Describe "Stack" -Skip:($os.IsVentura -or $os.IsSonoma) {
Describe "Stack" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
It "Stack" {
"stack --version" | Should -ReturnZeroExitCode
}
@@ -78,7 +78,7 @@ Describe "CocoaPods" {
}
}
Describe "VSMac" -Skip:($os.IsVentura -or $os.IsSonoma) {
Describe "VSMac" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
$vsMacVersions = (Get-ToolsetContent).xamarin.vsmac.versions
$defaultVSMacVersion = (Get-ToolsetContent).xamarin.vsmac.default
@@ -105,7 +105,7 @@ Describe "VSMac" -Skip:($os.IsVentura -or $os.IsSonoma) {
}
}
Describe "Swig" -Skip:($os.IsVentura -or $os.IsSonoma) {
Describe "Swig" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
It "Swig" {
"swig -version" | Should -ReturnZeroExitCode
}
@@ -117,13 +117,13 @@ Describe "Bicep" {
}
}
Describe "Go" -Skip:($os.IsVentura -or $os.IsSonoma) {
Describe "Go" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
It "Go" {
"go version" | Should -ReturnZeroExitCode
}
}
Describe "VirtualBox" -Skip:($os.IsVentura -or $os.IsSonoma) {
Describe "VirtualBox" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
It "Check kext kernel modules" {
kextstat | Out-String | Should -Match "org.virtualbox.kext"
}
@@ -141,7 +141,7 @@ Describe "CodeQL Bundle" {
}
}
Describe "Colima" -Skip:($os.IsVentura -or $os.IsSonoma) {
Describe "Colima" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
It "Colima" {
"colima version" | Should -ReturnZeroExitCode
}

View File

@@ -2,7 +2,7 @@ Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1"
$os = Get-OSVersion
Describe "MongoDB" -Skip:($os.IsVentura -or $os.IsSonoma) {
Describe "MongoDB" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
It "<ToolName>" -TestCases @(
@{ ToolName = "mongo" }
@{ ToolName = "mongod" }
@@ -12,7 +12,7 @@ Describe "MongoDB" -Skip:($os.IsVentura -or $os.IsSonoma) {
}
}
Describe "PostgreSQL" -Skip:($os.IsVentura -or $os.IsSonoma) {
Describe "PostgreSQL" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
It "PostgreSQL version should correspond to the version in the toolset" {
$toolsetVersion = (Get-ToolsetContent).postgresql.version
# Client version

View File

@@ -2,7 +2,7 @@ Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1"
$os = Get-OSVersion
Describe "Haskell" -Skip:($os.IsVentura -or $os.IsSonoma) {
Describe "Haskell" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
Context "GHCup" {
It "GHCup" {
"ghcup --version" | Should -ReturnZeroExitCode

View File

@@ -2,7 +2,7 @@ Import-Module "$PSScriptRoot/Helpers.psm1" -DisableNameChecking
$os = Get-OSVersion
Describe "SwiftLint" -Skip:($os.IsVenturaArm64 -or $os.IsSonomaArm64) {
Describe "SwiftLint" -Skip:($os.IsVenturaArm64 -or $os.IsSonomaArm64 -or $os.IsSequoiaArm64) {
It "SwiftLint" {
"swiftlint version" | Should -ReturnZeroExitCode
}

View File

@@ -21,7 +21,7 @@ Describe "Node.js" {
}
}
Describe "nvm" -Skip:($os.IsVentura -or $os.IsSonoma) {
Describe "nvm" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
BeforeAll {
$nvmPath = Join-Path $env:HOME ".nvm" "nvm.sh"
$nvmInitCommand = ". $nvmPath > /dev/null 2>&1 || true"

View File

@@ -3,7 +3,7 @@ Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1"
$os = Get-OSVersion
Describe "PHP" {
Context "PHP" -Skip:($os.IsVenturaArm64 -or $os.IsSonomaArm64) {
Context "PHP" -Skip:($os.IsVenturaArm64 -or $os.IsSonomaArm64 -or $os.IsSequoiaArm64) {
It "PHP Path" {
Get-ToolPath "php" | Should -Not -BeLike "/usr/bin/php*"
}
@@ -14,7 +14,7 @@ Describe "PHP" {
}
}
Context "Composer" -Skip:($os.IsVenturaArm64 -or $os.IsSonomaArm64) {
Context "Composer" -Skip:($os.IsVenturaArm64 -or $os.IsSonomaArm64 -or $os.IsSequoiaArm64) {
It "Composer" {
"composer --version" | Should -ReturnZeroExitCode
}

View File

@@ -3,7 +3,7 @@ Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1"
$os = Get-OSVersion
Describe "PipxPackages" -Skip:($os.IsVentura -or $os.IsSonoma) {
Describe "PipxPackages" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
$pipxToolset = (Get-ToolsetContent).pipx
$testCases = $pipxToolset | ForEach-Object { @{package = $_.package; cmd = $_.cmd} }
It "<package>" -TestCases $testCases {

View File

@@ -8,7 +8,7 @@ Describe "Python3" {
"python3 --version" | Should -ReturnZeroExitCode
}
if ($os.IsVenturaArm64 -or $os.IsSonomaArm64) {
if ($os.IsVenturaArm64 -or $os.IsSonomaArm64 -or $os.IsSequoiaArm64) {
It "Python 3 is installed under /opt/homebrew/bin/" {
Get-ToolPath "python3" | Should -BeLike "/opt/homebrew/bin/*"
}
@@ -34,7 +34,7 @@ Describe "Python3" {
}
Describe "Python2" -Skip:($os.IsVentura -or $os.IsSonoma) {
Describe "Python2" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
It "Python 2 is available" {
"/Library/Frameworks/Python.framework/Versions/2.7/bin/python --version" | Should -ReturnZeroExitCode
}

View File

@@ -20,25 +20,19 @@ Describe "Bundler" {
}
}
Describe "Nomad shenzhen CLI" -Skip:($os.IsMonterey -or $os.IsVentura -or $os.IsSonoma) {
It "Nomad shenzhen CLI" {
"ipa --version" | Should -ReturnZeroExitCode
}
}
Describe "Fastlane" {
It "Fastlane" {
"fastlane --version" | Should -ReturnZeroExitCode
}
}
Describe "xcpretty" -Skip:($os.IsVentura -or $os.IsSonoma) {
Describe "xcpretty" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
It "xcpretty" {
"xcpretty --version" | Should -ReturnZeroExitCode
}
}
Describe "jazzy" -Skip:($os.IsVentura -or $os.IsSonoma) {
Describe "jazzy" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
It "jazzy" {
"jazzy --version" | Should -ReturnZeroExitCode
}

View File

@@ -18,7 +18,7 @@ Describe "Rust" {
"cargo --version" | Should -ReturnZeroExitCode
}
}
Context "Cargo dependencies" -Skip:($os.IsVentura -or $os.IsSonoma) {
Context "Cargo dependencies" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
It "bindgen" {
"bindgen --version" | Should -ReturnZeroExitCode
}

View File

@@ -25,7 +25,7 @@ Describe "Certificate" {
}
}
Describe "Audio device" -Skip:($os.IsVentura -or $os.IsSonoma) {
Describe "Audio device" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
It "Sox is installed" {
"sox --version" | Should -ReturnZeroExitCode
}

View File

@@ -57,7 +57,7 @@ Describe "Toolcache" {
}
}
Context "Ruby" -Skip:($os.IsVenturaArm64 -or $os.IsSonomaArm64) {
Context "Ruby" -Skip:($os.IsVenturaArm64 -or $os.IsSonomaArm64 -or $os.IsSequoiaArm64) {
$rubyDirectory = Join-Path $toolcacheDirectory "Ruby"
$rubyPackage = $packages | Where-Object { $_.ToolName -eq "Ruby" } | Select-Object -First 1
$testCase = @{ RubyDirectory = $rubyDirectory }
@@ -99,7 +99,7 @@ Describe "Toolcache" {
}
}
}
Context "PyPy" -Skip:($os.IsVenturaArm64 -or $os.IsSonoma) {
Context "PyPy" -Skip:($os.IsVenturaArm64 -or $os.IsSonoma -or $os.IsSequoia) {
$pypyDirectory = Join-Path $toolcacheDirectory "PyPy"
$pypyPackage = $packages | Where-Object { $_.ToolName -eq "pypy" } | Select-Object -First 1
$testCase = @{ PypyDirectory = $pypyDirectory }

View File

@@ -2,7 +2,7 @@ Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1"
$os = Get-OSVersion
Describe "Apache" -Skip:($os.IsVentura -or $os.IsSonoma) {
Describe "Apache" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
It "Apache CLI" {
"httpd -v" | Should -ReturnZeroExitCode
}
@@ -13,7 +13,7 @@ Describe "Apache" -Skip:($os.IsVentura -or $os.IsSonoma) {
}
}
Describe "Nginx" -Skip:($os.IsVentura -or $os.IsSonoma) {
Describe "Nginx" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
It "Nginx CLI" {
"nginx -v" | Should -ReturnZeroExitCode
}

View File

@@ -13,6 +13,8 @@ if ($os.IsVentura -or $os.IsSonoma) {
$XAMARIN_IOS_VERSIONS = (Get-ToolsetContent).xamarin.ios_versions
$XAMARIN_MAC_VERSIONS = (Get-ToolsetContent).xamarin.mac_versions
$XAMARIN_ANDROID_VERSIONS = (Get-ToolsetContent).xamarin.android_versions
} elseif ($os.IsSequoia) {
Write-Host "Skipping all the Mono and Xamarin tests as deprecated"
}
BeforeAll {
@@ -26,7 +28,7 @@ BeforeAll {
}
}
Describe "Mono" {
Describe "Mono" -Skip:($os.IsSequoia) {
$MONO_VERSIONS | ForEach-Object {
Context "$_" {
$MONO_VERSIONS_PATH = "/Library/Frameworks/Mono.framework/Versions"
@@ -90,7 +92,7 @@ Describe "Mono" {
}
}
Describe "Xamarin.iOS" -Skip:($os.IsVentura -or $os.IsSonoma) {
Describe "Xamarin.iOS" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
$XAMARIN_IOS_VERSIONS | ForEach-Object {
Context "$_" {
$XAMARIN_IOS_VERSIONS_PATH = "/Library/Frameworks/Xamarin.iOS.framework/Versions"
@@ -123,7 +125,7 @@ Describe "Xamarin.iOS" -Skip:($os.IsVentura -or $os.IsSonoma) {
}
}
Describe "Xamarin.Mac" -Skip:($os.IsVentura -or $os.IsSonoma) {
Describe "Xamarin.Mac" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
$XAMARIN_MAC_VERSIONS | ForEach-Object {
Context "$_" {
$XAMARIN_MAC_VERSIONS_PATH = "/Library/Frameworks/Xamarin.Mac.framework/Versions"
@@ -156,7 +158,7 @@ Describe "Xamarin.Mac" -Skip:($os.IsVentura -or $os.IsSonoma) {
}
}
Describe "Xamarin.Android" -Skip:($os.IsVentura -or $os.IsSonoma) {
Describe "Xamarin.Android" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
$XAMARIN_ANDROID_VERSIONS | ForEach-Object {
Context "$_" {
$XAMARIN_ANDROID_VERSIONS_PATH = "/Library/Frameworks/Xamarin.Android.framework/Versions"
@@ -196,7 +198,7 @@ Describe "Xamarin.Android" -Skip:($os.IsVentura -or $os.IsSonoma) {
}
}
Describe "Xamarin Bundles" -Skip:($os.IsVentura -or $os.IsSonoma) {
Describe "Xamarin Bundles" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
BeforeAll {
$MONO_VERSIONS_PATH = "/Library/Frameworks/Mono.framework/Versions"
$XAMARIN_IOS_VERSIONS_PATH = "/Library/Frameworks/Xamarin.iOS.framework/Versions"
@@ -303,7 +305,7 @@ Describe "Xamarin Bundles" -Skip:($os.IsVentura -or $os.IsSonoma) {
}
}
Describe "Nuget" -Skip:($os.IsVentura -or $os.IsSonoma) {
Describe "Nuget" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
It "Nuget config contains nuget.org feed" {
Get-Content $env:HOME/.config/NuGet/NuGet.Config | Out-String | Should -Match "nuget.org"
}

View File

@@ -28,6 +28,13 @@ Describe "Xcode" {
$defaultXcodeTestCase = @{ DefaultXcode = $defaultXcode }
It "Default Xcode is <DefaultXcode>" -TestCases $defaultXcodeTestCase {
"xcodebuild -version" | Should -ReturnZeroExitCode
If ($DefaultXcode -ilike "*beta*") {
Write-Host "Beta version detected"
$DefaultXcode = $DefaultXcode.split("_")[0]
If ($DefaultXcode -notlike "*.*") {
$DefaultXcode = "${DefaultXcode}.0"
}
}
(Get-CommandResult "xcodebuild -version").Output | Should -BeLike "Xcode ${DefaultXcode}*"
}

View File

@@ -250,7 +250,6 @@ build {
"${path.root}/../scripts/build/install-chrome.sh",
"${path.root}/../scripts/build/install-edge.sh",
"${path.root}/../scripts/build/install-firefox.sh",
"${path.root}/../scripts/build/install-pypy.sh",
"${path.root}/../scripts/build/install-bicep.sh",
"${path.root}/../scripts/build/install-codeql-bundle.sh"
]

View File

@@ -0,0 +1,293 @@
packer {
required_plugins {
veertu-anka = {
version = ">= v3.2.0"
source = "github.com/veertuinc/veertu-anka"
}
}
}
locals {
image_folder = "/Users/${var.vm_username}/image-generation"
}
variable "builder_type" {
type = string
default = "veertu-anka-vm-clone"
validation {
condition = contains(["veertu-anka-vm-clone", "null"], var.builder_type)
error_message = "The builder_type value must be one of [veertu-anka-vm-clone, null]."
}
}
variable "source_vm_name" {
type = string
}
variable "source_vm_port" {
type = number
default = 22
}
variable "source_vm_tag" {
type = string
default = ""
}
variable "socks_proxy" {
type = string
default = ""
}
variable "build_id" {
type = string
}
variable "vm_username" {
type = string
sensitive = true
}
variable "vm_password" {
type = string
sensitive = true
}
variable "github_api_pat" {
type = string
sensitive = true
default = ""
}
variable "xcode_install_storage_url" {
type = string
sensitive = true
}
variable "xcode_install_sas" {
type = string
sensitive = true
}
variable "vcpu_count" {
type = string
default = "6"
}
variable "ram_size" {
type = string
default = "8G"
}
variable "image_os" {
type = string
default = "macos15"
}
source "veertu-anka-vm-clone" "template" {
vm_name = "${var.build_id}"
source_vm_name = "${var.source_vm_name}"
source_vm_tag = "${var.source_vm_tag}"
vcpu_count = "${var.vcpu_count}"
ram_size = "${var.ram_size}"
stop_vm = "true"
}
source "null" "template" {
ssh_host = "${var.source_vm_name}"
ssh_port = "${var.source_vm_port}"
ssh_username = "${var.vm_username}"
ssh_password = "${var.vm_password}"
ssh_proxy_host = "${var.socks_proxy}"
}
build {
sources = ["source.${var.builder_type}.template"]
provisioner "shell" {
inline = ["mkdir ${local.image_folder}"]
}
provisioner "file" {
destination = "${local.image_folder}/"
sources = [
"${path.root}/../scripts/tests",
"${path.root}/../scripts/docs-gen",
"${path.root}/../scripts/helpers"
]
}
provisioner "file" {
destination = "${local.image_folder}/docs-gen/"
source = "${path.root}/../../../helpers/software-report-base"
}
provisioner "file" {
destination = "${local.image_folder}/add-certificate.swift"
source = "${path.root}/../assets/add-certificate.swift"
}
provisioner "file" {
destination = ".bashrc"
source = "${path.root}/../assets/bashrc"
}
provisioner "file" {
destination = ".bash_profile"
source = "${path.root}/../assets/bashprofile"
}
provisioner "shell" {
inline = ["mkdir ~/bootstrap"]
}
provisioner "file" {
destination = "bootstrap"
source = "${path.root}/../assets/bootstrap-provisioner/"
}
provisioner "file" {
destination = "${local.image_folder}/toolset.json"
source = "${path.root}/../toolsets/toolset-15.json"
}
provisioner "shell" {
execute_command = "sudo sh -c '{{ .Vars }} {{ .Path }}'"
inline = [
"mv ${local.image_folder}/docs-gen ${local.image_folder}/software-report",
"mkdir ~/utils",
"mv ${local.image_folder}/helpers/invoke-tests.sh ~/utils",
"mv ${local.image_folder}/helpers/utils.sh ~/utils"
]
}
provisioner "shell" {
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
scripts = [
"${path.root}/../scripts/build/install-xcode-clt.sh",
"${path.root}/../scripts/build/install-homebrew.sh"
]
}
provisioner "shell" {
environment_vars = ["PASSWORD=${var.vm_password}", "USERNAME=${var.vm_username}"]
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; sudo {{ .Vars }} {{ .Path }}"
scripts = [
"${path.root}/../scripts/build/configure-tccdb-macos.sh",
"${path.root}/../scripts/build/configure-auto-updates.sh",
"${path.root}/../scripts/build/configure-ntpconf.sh",
"${path.root}/../scripts/build/configure-shell.sh"
]
}
provisioner "shell" {
environment_vars = ["IMAGE_VERSION=${var.build_id}", "IMAGE_OS=${var.image_os}", "PASSWORD=${var.vm_password}"]
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
scripts = [
"${path.root}/../scripts/build/configure-preimagedata.sh",
"${path.root}/../scripts/build/configure-ssh.sh",
"${path.root}/../scripts/build/configure-machine.sh"
]
}
provisioner "shell" {
execute_command = "source $HOME/.bash_profile; sudo {{ .Vars }} {{ .Path }}"
expect_disconnect = true
inline = ["echo 'Reboot VM'", "shutdown -r now"]
}
provisioner "shell" {
environment_vars = ["API_PAT=${var.github_api_pat}", "USER_PASSWORD=${var.vm_password}", "IMAGE_FOLDER=${local.image_folder}"]
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
pause_before = "30s"
scripts = [
"${path.root}/../scripts/build/install-powershell.sh",
"${path.root}/../scripts/build/install-dotnet.sh",
"${path.root}/../scripts/build/install-python.sh",
"${path.root}/../scripts/build/install-azcopy.sh",
"${path.root}/../scripts/build/install-openssl.sh",
"${path.root}/../scripts/build/install-ruby.sh",
"${path.root}/../scripts/build/install-rubygems.sh",
"${path.root}/../scripts/build/install-git.sh",
"${path.root}/../scripts/build/install-node.sh",
"${path.root}/../scripts/build/install-common-utils.sh"
]
}
provisioner "shell" {
environment_vars = ["XCODE_INSTALL_STORAGE_URL=${var.xcode_install_storage_url}", "XCODE_INSTALL_SAS=${var.xcode_install_sas}", "IMAGE_FOLDER=${local.image_folder}"]
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} pwsh -f {{ .Path }}"
script = "${path.root}/../scripts/build/Install-Xcode.ps1"
}
provisioner "shell" {
execute_command = "source $HOME/.bash_profile; sudo {{ .Vars }} {{ .Path }}"
expect_disconnect = true
inline = ["echo 'Reboot VM'", "shutdown -r now"]
}
provisioner "shell" {
environment_vars = ["API_PAT=${var.github_api_pat}", "IMAGE_FOLDER=${local.image_folder}"]
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
scripts = [
"${path.root}/../scripts/build/install-actions-cache.sh",
"${path.root}/../scripts/build/install-llvm.sh",
"${path.root}/../scripts/build/install-swiftlint.sh",
"${path.root}/../scripts/build/install-openjdk.sh",
"${path.root}/../scripts/build/install-php.sh",
"${path.root}/../scripts/build/install-aws-tools.sh",
"${path.root}/../scripts/build/install-rust.sh",
"${path.root}/../scripts/build/install-gcc.sh",
"${path.root}/../scripts/build/install-cocoapods.sh",
"${path.root}/../scripts/build/install-android-sdk.sh",
"${path.root}/../scripts/build/install-safari.sh",
"${path.root}/../scripts/build/install-chrome.sh",
"${path.root}/../scripts/build/install-edge.sh",
"${path.root}/../scripts/build/install-firefox.sh",
"${path.root}/../scripts/build/install-bicep.sh",
"${path.root}/../scripts/build/install-codeql-bundle.sh"
]
}
provisioner "shell" {
environment_vars = ["IMAGE_FOLDER=${local.image_folder}"]
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} pwsh -f {{ .Path }}"
scripts = [
"${path.root}/../scripts/build/Install-Toolset.ps1",
"${path.root}/../scripts/build/Configure-Toolset.ps1"
]
}
provisioner "shell" {
environment_vars = ["IMAGE_FOLDER=${local.image_folder}"]
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} pwsh -f {{ .Path }}"
script = "${path.root}/../scripts/build/Configure-Xcode-Simulators.ps1"
}
provisioner "shell" {
environment_vars = ["IMAGE_FOLDER=${local.image_folder}"]
execute_command = "source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
inline = [
"pwsh -File \"${local.image_folder}/software-report/Generate-SoftwareReport.ps1\" -OutputDirectory \"${local.image_folder}/output/software-report\" -ImageName ${var.build_id}",
"pwsh -File \"${local.image_folder}/tests/RunAll-Tests.ps1\""
]
}
provisioner "file" {
destination = "${path.root}/../../image-output/"
direction = "download"
source = "${local.image_folder}/output/"
}
provisioner "shell" {
inline = ["rm -rf \"$(brew --cache)\""]
}
provisioner "shell" {
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
scripts = [
"${path.root}/../scripts/build/configure-hostname.sh",
"${path.root}/../scripts/build/configure-system.sh"
]
}
}

View File

@@ -0,0 +1,285 @@
packer {
required_plugins {
veertu-anka = {
version = ">= v3.2.0"
source = "github.com/veertuinc/veertu-anka"
}
}
}
locals {
image_folder = "/Users/${var.vm_username}/image-generation"
}
variable "builder_type" {
type = string
default = "veertu-anka-vm-clone"
validation {
condition = contains(["veertu-anka-vm-clone", "null"], var.builder_type)
error_message = "The builder_type value must be one of [veertu-anka-vm-clone, null]."
}
}
variable "source_vm_name" {
type = string
}
variable "source_vm_port" {
type = number
default = 22
}
variable "source_vm_tag" {
type = string
default = ""
}
variable "socks_proxy" {
type = string
default = ""
}
variable "build_id" {
type = string
}
variable "vm_username" {
type = string
sensitive = true
}
variable "vm_password" {
type = string
sensitive = true
}
variable "github_api_pat" {
type = string
sensitive = true
default = ""
}
variable "xcode_install_storage_url" {
type = string
sensitive = true
}
variable "xcode_install_sas" {
type = string
sensitive = true
}
variable "vcpu_count" {
type = string
default = "6"
}
variable "ram_size" {
type = string
default = "8G"
}
variable "image_os" {
type = string
default = "macos15"
}
source "veertu-anka-vm-clone" "template" {
vm_name = "${var.build_id}"
source_vm_name = "${var.source_vm_name}"
source_vm_tag = "${var.source_vm_tag}"
vcpu_count = "${var.vcpu_count}"
ram_size = "${var.ram_size}"
stop_vm = "true"
log_level = "debug"
}
source "null" "template" {
ssh_host = "${var.source_vm_name}"
ssh_port = "${var.source_vm_port}"
ssh_username = "${var.vm_username}"
ssh_password = "${var.vm_password}"
ssh_proxy_host = "${var.socks_proxy}"
}
build {
sources = ["source.${var.builder_type}.template"]
provisioner "shell" {
inline = ["mkdir ${local.image_folder}"]
}
provisioner "file" {
destination = "${local.image_folder}/"
sources = [
"${path.root}/../scripts/tests",
"${path.root}/../scripts/docs-gen",
"${path.root}/../scripts/helpers"
]
}
provisioner "file" {
destination = "${local.image_folder}/docs-gen/"
source = "${path.root}/../../../helpers/software-report-base"
}
provisioner "file" {
destination = "${local.image_folder}/add-certificate.swift"
source = "${path.root}/../assets/add-certificate.swift"
}
provisioner "file" {
destination = ".bashrc"
source = "${path.root}/../assets/bashrc"
}
provisioner "file" {
destination = ".bash_profile"
source = "${path.root}/../assets/bashprofile"
}
provisioner "shell" {
inline = ["mkdir ~/bootstrap"]
}
provisioner "file" {
destination = "bootstrap"
source = "${path.root}/../assets/bootstrap-provisioner/"
}
provisioner "file" {
destination = "${local.image_folder}/toolset.json"
source = "${path.root}/../toolsets/toolset-15.json"
}
provisioner "shell" {
execute_command = "sudo sh -c '{{ .Vars }} {{ .Path }}'"
inline = [
"mv ${local.image_folder}/docs-gen ${local.image_folder}/software-report",
"mkdir ~/utils",
"mv ${local.image_folder}/helpers/invoke-tests.sh ~/utils",
"mv ${local.image_folder}/helpers/utils.sh ~/utils"
]
}
provisioner "shell" {
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
scripts = [
"${path.root}/../scripts/build/install-xcode-clt.sh",
"${path.root}/../scripts/build/install-homebrew.sh",
"${path.root}/../scripts/build/install-rosetta.sh"
]
}
provisioner "shell" {
environment_vars = ["PASSWORD=${var.vm_password}", "USERNAME=${var.vm_username}"]
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; sudo {{ .Vars }} {{ .Path }}"
scripts = [
"${path.root}/../scripts/build/configure-tccdb-macos.sh",
"${path.root}/../scripts/build/configure-auto-updates.sh",
"${path.root}/../scripts/build/configure-ntpconf.sh",
"${path.root}/../scripts/build/configure-shell.sh"
]
}
provisioner "shell" {
environment_vars = ["IMAGE_VERSION=${var.build_id}", "IMAGE_OS=${var.image_os}", "PASSWORD=${var.vm_password}"]
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
scripts = [
"${path.root}/../scripts/build/configure-preimagedata.sh",
"${path.root}/../scripts/build/configure-ssh.sh",
"${path.root}/../scripts/build/configure-machine.sh"
]
}
provisioner "shell" {
execute_command = "source $HOME/.bash_profile; sudo {{ .Vars }} {{ .Path }}"
expect_disconnect = true
inline = ["echo 'Reboot VM'", "shutdown -r now"]
}
provisioner "shell" {
environment_vars = ["API_PAT=${var.github_api_pat}", "USER_PASSWORD=${var.vm_password}", "IMAGE_FOLDER=${local.image_folder}"]
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
pause_before = "30s"
scripts = [
"${path.root}/../scripts/build/configure-windows.sh",
"${path.root}/../scripts/build/install-powershell.sh",
"${path.root}/../scripts/build/install-dotnet.sh",
"${path.root}/../scripts/build/install-python.sh",
"${path.root}/../scripts/build/install-azcopy.sh",
"${path.root}/../scripts/build/install-openssl.sh",
"${path.root}/../scripts/build/install-ruby.sh",
"${path.root}/../scripts/build/install-rubygems.sh",
"${path.root}/../scripts/build/install-git.sh",
"${path.root}/../scripts/build/install-node.sh",
"${path.root}/../scripts/build/install-common-utils.sh"
]
}
provisioner "shell" {
environment_vars = ["XCODE_INSTALL_STORAGE_URL=${var.xcode_install_storage_url}", "XCODE_INSTALL_SAS=${var.xcode_install_sas}", "IMAGE_FOLDER=${local.image_folder}"]
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} pwsh -f {{ .Path }}"
script = "${path.root}/../scripts/build/Install-Xcode.ps1"
}
provisioner "shell" {
execute_command = "source $HOME/.bash_profile; sudo {{ .Vars }} {{ .Path }}"
expect_disconnect = true
inline = ["echo 'Reboot VM'", "shutdown -r now"]
}
provisioner "shell" {
environment_vars = ["API_PAT=${var.github_api_pat}", "IMAGE_FOLDER=${local.image_folder}"]
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
scripts = [
"${path.root}/../scripts/build/install-actions-cache.sh",
"${path.root}/../scripts/build/install-llvm.sh",
"${path.root}/../scripts/build/install-openjdk.sh",
"${path.root}/../scripts/build/install-aws-tools.sh",
"${path.root}/../scripts/build/install-rust.sh",
"${path.root}/../scripts/build/install-gcc.sh",
"${path.root}/../scripts/build/install-cocoapods.sh",
"${path.root}/../scripts/build/install-android-sdk.sh",
"${path.root}/../scripts/build/install-safari.sh",
"${path.root}/../scripts/build/install-chrome.sh",
"${path.root}/../scripts/build/install-bicep.sh",
"${path.root}/../scripts/build/install-codeql-bundle.sh"
]
}
provisioner "shell" {
environment_vars = ["IMAGE_FOLDER=${local.image_folder}"]
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} pwsh -f {{ .Path }}"
scripts = [
"${path.root}/../scripts/build/Install-Toolset.ps1",
"${path.root}/../scripts/build/Configure-Toolset.ps1"
]
}
provisioner "shell" {
environment_vars = ["IMAGE_FOLDER=${local.image_folder}"]
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} pwsh -f {{ .Path }}"
script = "${path.root}/../scripts/build/Configure-Xcode-Simulators.ps1"
}
provisioner "shell" {
environment_vars = ["IMAGE_FOLDER=${local.image_folder}"]
execute_command = "source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
inline = [
"pwsh -File \"${local.image_folder}/software-report/Generate-SoftwareReport.ps1\" -OutputDirectory \"${local.image_folder}/output/software-report\" -ImageName ${var.build_id}",
"pwsh -File \"${local.image_folder}/tests/RunAll-Tests.ps1\""
]
}
provisioner "file" {
destination = "${path.root}/../../image-output/"
direction = "download"
source = "${local.image_folder}/output/"
}
provisioner "shell" {
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
scripts = ["${path.root}/../scripts/build/configure-hostname.sh"]
}
}

View File

@@ -0,0 +1,204 @@
{
"xcode": {
"default": "16.1_beta",
"x64": {
"versions": [
{ "link": "16.1_beta", "version": "16.1.0-Beta+16B5001e", "symlinks": ["16.1"], "install_runtimes": "true", "sha256": "8848aacb32bdc0abbd7e14e4b712e07c98f4b6e5a23a8d77db03ab21dcb3c777"},
{ "link": "16_beta_6", "version": "16.0.0-Beta.6+16A5230g", "symlinks": ["16.0"], "install_runtimes": "true", "sha256": "ab0b9a4f6d723420ee0e39ff1cf6a628665dfe832053f66b6b72e013a6bbb244"},
{ "link": "15.4", "version": "15.4.0+15F31d", "install_runtimes": "true", "sha256": "82d3d61804ff3f4c7c82085e91dc701037ddaa770e542848b2477e22f4e8aa7a"}
]
},
"arm64":{
"versions": [
{ "link": "16.1_beta", "version": "16.1.0-Beta+16B5001e", "symlinks": ["16.1"], "install_runtimes": "true", "sha256": "8848aacb32bdc0abbd7e14e4b712e07c98f4b6e5a23a8d77db03ab21dcb3c777"},
{ "link": "16_beta_6", "version": "16.0.0-Beta.6+16A5230g", "symlinks": ["16.0"], "install_runtimes": "true", "sha256": "ab0b9a4f6d723420ee0e39ff1cf6a628665dfe832053f66b6b72e013a6bbb244"},
{ "link": "15.4", "version": "15.4.0+15F31d", "install_runtimes": "true", "sha256": "82d3d61804ff3f4c7c82085e91dc701037ddaa770e542848b2477e22f4e8aa7a"}
]
}
},
"java": {
"x64": {
"default": "21",
"versions": [ "11", "17", "21"]
},
"arm64": {
"default": "21",
"versions": [ "11", "17", "21"]
}
},
"android": {
"cmdline-tools": "commandlinetools-mac-12172612_latest.zip",
"sdk-tools": "sdk-tools-darwin-4333796.zip",
"platform_min_version": "35",
"build_tools_min_version": "35.0.2",
"extras": [
"android;m2repository", "google;m2repository", "google;google_play_services"
],
"addons": [],
"additional_tools": [
"cmake;3.22.1"
],
"ndk": {
"default": "27",
"versions": [
"25", "26", "27"
]
}
},
"powershellModules": [
{ "name": "Az" },
{ "name": "Pester" },
{ "name": "PSScriptAnalyzer" }
],
"brew": {
"common_packages": [
"ant",
"aria2",
"azure-cli",
"bazelisk",
"carthage",
"cmake",
"gh",
"gnupg",
"gnu-tar",
"kotlin",
"libpq",
"libsodium",
"p7zip",
"packer",
"perl",
"pkg-config",
"swiftformat",
"zstd",
"gmp",
"yq",
"unxip",
"xcbeautify",
"xcodes"
],
"cask_packages": [
""
]
},
"gcc": {
"versions": [
"12",
"13",
"14"
]
},
"dotnet": {
"arch":{
"x64": {
"versions": [
"7.0",
"8.0"
]
},
"arm64": {
"versions": [
"7.0",
"8.0"
]
}
}
},
"ruby": {
"default": "3.3",
"rubygems": [
"cocoapods",
"bundler",
"fastlane"
]
},
"toolcache": [
{
"name": "Python",
"url" : "https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json",
"platform" : "darwin",
"arch": {
"x64": {
"versions": [
"3.9.*",
"3.10.*",
"3.11.*",
"3.12.*"
]
},
"arm64": {
"versions": [
"3.9.*",
"3.10.*",
"3.11.*",
"3.12.*"
]
}
}
},
{
"name": "Node",
"url" : "https://raw.githubusercontent.com/actions/node-versions/main/versions-manifest.json",
"platform" : "darwin",
"arch": {
"x64": {
"versions": [
"18.*",
"20.*"
]
},
"arm64": {
"versions": [
"18.*",
"20.*"
]
}
}
},
{
"name": "Go",
"url" : "https://raw.githubusercontent.com/actions/go-versions/main/versions-manifest.json",
"platform" : "darwin",
"arch": {
"x64": {
"variable_template" : "GOROOT_{0}_{1}_X64",
"versions": [
"1.21.*",
"1.22.*",
"1.23.*"
]
},
"arm64": {
"variable_template" : "GOROOT_{0}_{1}_ARM64",
"versions": [
"1.21.*",
"1.22.*",
"1.23.*"
]
}
}
},
{
"name": "Ruby",
"arch": {
"x64": {
"versions": [
"3.1.*",
"3.2.*"
]
}
}
}
],
"node": {
"default": "22"
},
"llvm": {
"version": "18"
},
"php": {
"version": "8.3"
},
"pwsh": {
"version": "7.4"
}
}