mirror of
https://github.com/actions/runner-images.git
synced 2025-12-12 12:06:59 +00:00
[macOS] Update SoftwareReport scripts (#9092)
This commit is contained in:
@@ -44,7 +44,6 @@ $xcodeVersions | ForEach-Object {
|
|||||||
$xcodebuildPath = Get-XcodeToolPath -Version $_.link -ToolName 'xcodebuild'
|
$xcodebuildPath = Get-XcodeToolPath -Version $_.link -ToolName 'xcodebuild'
|
||||||
Invoke-ValidateCommand "sudo $xcodebuildPath -downloadPlatform $runtime" | Out-Null
|
Invoke-ValidateCommand "sudo $xcodebuildPath -downloadPlatform $runtime" | Out-Null
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Invoke-XcodeRunFirstLaunch -Version $defaultXcode
|
Invoke-XcodeRunFirstLaunch -Version $defaultXcode
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ function Build-OSInfoSection {
|
|||||||
)
|
)
|
||||||
|
|
||||||
$fieldsToInclude = @("System Version:", "Kernel Version:")
|
$fieldsToInclude = @("System Version:", "Kernel Version:")
|
||||||
$rawSystemInfo = Invoke-Expression "system_profiler SPSoftwareDataType"
|
$rawSystemInfo = Run-Command "system_profiler SPSoftwareDataType"
|
||||||
$parsedSystemInfo = $rawSystemInfo | Where-Object { -not ($_ | Select-String -NotMatch $fieldsToInclude) } | ForEach-Object { $_.Trim() }
|
$parsedSystemInfo = $rawSystemInfo | Where-Object { -not ($_ | Select-String -NotMatch $fieldsToInclude) } | ForEach-Object { $_.Trim() }
|
||||||
$parsedSystemInfo[0] -match "System Version: macOS (?<version>\d+)" | Out-Null
|
$parsedSystemInfo[0] -match "System Version: macOS (?<version>\d+)" | Out-Null
|
||||||
$version = $Matches.Version
|
$version = $Matches.Version
|
||||||
@@ -169,12 +169,12 @@ function Build-OSInfoSection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Get-MonoVersion {
|
function Get-MonoVersion {
|
||||||
$monoVersion = mono --version | Out-String | Take-Part -Part 4
|
$monoVersion = Run-Command "mono --version" | Out-String | Take-Part -Part 4
|
||||||
return $monoVersion
|
return $monoVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-MSBuildVersion {
|
function Get-MSBuildVersion {
|
||||||
$msbuildVersion = msbuild -version | Select-Object -Last 1
|
$msbuildVersion = Run-Command "msbuild -version" | Select-Object -Last 1
|
||||||
$monoVersion = Get-MonoVersion
|
$monoVersion = Get-MonoVersion
|
||||||
return "$msbuildVersion (Mono $monoVersion)"
|
return "$msbuildVersion (Mono $monoVersion)"
|
||||||
}
|
}
|
||||||
@@ -250,7 +250,7 @@ function Get-NuGetVersion {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Get-CondaVersion {
|
function Get-CondaVersion {
|
||||||
$condaVersion = Invoke-Expression "conda --version"
|
$condaVersion = Run-Command "conda --version"
|
||||||
return ($condaVersion -replace "^conda").Trim()
|
return ($condaVersion -replace "^conda").Trim()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -312,7 +312,7 @@ function Get-SVNVersion {
|
|||||||
|
|
||||||
function Get-PackerVersion {
|
function Get-PackerVersion {
|
||||||
# Packer 1.7.1 has a bug and outputs version to stderr instead of stdout https://github.com/hashicorp/packer/issues/10855
|
# Packer 1.7.1 has a bug and outputs version to stderr instead of stdout https://github.com/hashicorp/packer/issues/10855
|
||||||
$result = Run-Command -Command "packer --version"
|
$result = Run-Command "packer --version"
|
||||||
$packerVersion = [regex]::matches($result, "(\d+.){2}\d+").Value
|
$packerVersion = [regex]::matches($result, "(\d+.){2}\d+").Value
|
||||||
return $packerVersion
|
return $packerVersion
|
||||||
}
|
}
|
||||||
@@ -538,22 +538,22 @@ function Get-JazzyVersion {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Get-ZlibVersion {
|
function Get-ZlibVersion {
|
||||||
$zlibVersion = brew info --json zlib | jq -r '.[].installed[].version'
|
$zlibVersion = (Run-Command "brew info --json zlib" | ConvertFrom-Json).installed.version
|
||||||
return $zlibVersion
|
return $zlibVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-LibXftVersion {
|
function Get-LibXftVersion {
|
||||||
$libXftVersion = brew info --json libxft | jq -r '.[].installed[].version'
|
$libXftVersion = (Run-Command "brew info --json libxft" | ConvertFrom-Json).installed.version
|
||||||
return $libXftVersion
|
return $libXftVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-LibXextVersion {
|
function Get-LibXextVersion {
|
||||||
$libXextVersion = brew info --json libxext | jq -r '.[].installed[].version'
|
$libXextVersion = (Run-Command "brew info --json libxext" | ConvertFrom-Json).installed.version
|
||||||
return $libXextVersion
|
return $libXextVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-TclTkVersion {
|
function Get-TclTkVersion {
|
||||||
$tcltkVersion = brew info --json tcl-tk | jq -r '.[].installed[].version'
|
$tcltkVersion = (Run-Command "brew info --json tcl-tk" | ConvertFrom-Json).installed.version
|
||||||
return $tcltkVersion
|
return $tcltkVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ function Get-AvailableXcodeVersions {
|
|||||||
$availableVersions = $rawVersionsList | ForEach-Object {
|
$availableVersions = $rawVersionsList | ForEach-Object {
|
||||||
$partStable,$partMajor = $_.Split(" ", 2)
|
$partStable,$partMajor = $_.Split(" ", 2)
|
||||||
$semver = $stableSemver = [SemVer]::Parse($partStable)
|
$semver = $stableSemver = [SemVer]::Parse($partStable)
|
||||||
|
|
||||||
if ($partMajor) {
|
if ($partMajor) {
|
||||||
# Convert 'beta 3' -> 'beta.3', 'Release Candidate' -> 'releasecandidate', 'GM Seed 2' -> 'gmseed.2'
|
# Convert 'beta 3' -> 'beta.3', 'Release Candidate' -> 'releasecandidate', 'GM Seed 2' -> 'gmseed.2'
|
||||||
$normalizedLabel = $partMajor.toLower() -replace " (\d)", '.$1' -replace " ([a-z])", '$1'
|
$normalizedLabel = $partMajor.toLower() -replace " (\d)", '.$1' -replace " ([a-z])", '$1'
|
||||||
|
|||||||
Reference in New Issue
Block a user