Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .pipelines/templates/mac-package-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ jobs:
Restore-PSOptions -PSOptionsPath "$psoptionsPath"
Get-PSOptions | Write-Verbose -Verbose

if (-not (Test-Path "$repoRoot/tools/metadata.json")) {
throw "metadata.json not found in $repoRoot/tools"
}

$metadata = Get-Content "$repoRoot/tools/metadata.json" -Raw | ConvertFrom-Json
Comment on lines +105 to 109
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The thrown message is a bit ambiguous: it says metadata.json not found in "$repoRoot/tools" but the check is for the specific file path "$repoRoot/tools/metadata.json". Consider including the full path you tested (and/or the resolved $repoRoot value) to make failures easier to diagnose on build agents.

Suggested change
if (-not (Test-Path "$repoRoot/tools/metadata.json")) {
throw "metadata.json not found in $repoRoot/tools"
}
$metadata = Get-Content "$repoRoot/tools/metadata.json" -Raw | ConvertFrom-Json
$metadataPath = "$repoRoot/tools/metadata.json"
if (-not (Test-Path $metadataPath)) {
throw "metadata.json not found at path: $metadataPath"
}
$metadata = Get-Content $metadataPath -Raw | ConvertFrom-Json

Copilot uses AI. Check for mistakes.

Write-Verbose -Verbose "metadata:"
Expand All @@ -120,14 +124,19 @@ jobs:
Write-Verbose -Verbose "LTS: $LTS"

if ($LTS) {
Write-Verbose -Message "LTS Release: $LTS"
Write-Verbose -Message "LTS Release: $LTS" -Verbose
}

Start-PSBootstrap -Scenario Package

$macosRuntime = "osx-$buildArch"

Start-PSPackage -Type osxpkg -SkipReleaseChecks -MacOSRuntime $macosRuntime -ReleaseTag $(ReleaseTagVar) -PackageBinPath $signedFilesPath -LTS:$LTS
Start-PSPackage -Type osxpkg -SkipReleaseChecks -MacOSRuntime $macosRuntime -ReleaseTag $(ReleaseTagVar) -PackageBinPath $signedFilesPath

if ($LTS) {
Start-PSPackage -Type osxpkg -SkipReleaseChecks -MacOSRuntime $macosRuntime -ReleaseTag $(ReleaseTagVar) -PackageBinPath $signedFilesPath -LTS
}

$pkgNameFilter = "powershell-*$macosRuntime.pkg"
Write-Verbose -Verbose "Looking for pkg packages with filter: $pkgNameFilter in '$(Pipeline.Workspace)' to upload..."
$pkgPath = Get-ChildItem -Path $(Pipeline.Workspace) -Filter $pkgNameFilter -Recurse -File
Expand Down
Loading