From 70957639a04358f4cda1cabbc530ad01db4e7281 Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Tue, 10 Mar 2026 22:28:16 +0000 Subject: [PATCH 1/3] Merged PR 38899: Fix signing for .nupkg Fix signing for .nupkg, defining ADO variable ---- #### AI description (iteration 1) #### PR Classification Bug fix to resolve issues with signing .nupkg packages in the pipeline. #### PR Summary This pull request adjusts the pipeline steps to ensure the correct directory path is used for signing the .nupkg, while adding debugging steps to verify the directory contents before and after signing. - `/pipelines/PSResourceGet-Official.yml`: Introduces a `publishPath` variable using `Join-Path` to reliably point to the `PublishedNupkg` directory. - `/pipelines/PSResourceGet-Official.yml`: Updates registration, signing, and directory navigation steps to use `publishPath` instead of hardcoded paths, and adds commands to output folder contents for debugging. --- .pipelines/PSResourceGet-Official.yml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/.pipelines/PSResourceGet-Official.yml b/.pipelines/PSResourceGet-Official.yml index a44d53651..9728e5b8a 100644 --- a/.pipelines/PSResourceGet-Official.yml +++ b/.pipelines/PSResourceGet-Official.yml @@ -234,25 +234,34 @@ extends: Import-Module -Name Microsoft.PowerShell.PSResourceGet -Force Set-Location "$(signOutPath)\Microsoft.PowerShell.PSResourceGet" - $null = New-Item -ItemType Directory -Path "$(signOutPath)\PublishedNupkg" -Force + $publishPath = Join-Path $(signOutPath) -ChildPath 'PublishedNupkg' - Register-PSResourceRepository -Name 'localRepo' -Uri "$(signOutPath)\PublishedNupkg" + $null = New-Item -ItemType Directory -Path $publishPath -Force + + Register-PSResourceRepository -Name 'localRepo' -Uri $publishPath Publish-PSResource -Path "$(signOutPath)\Microsoft.PowerShell.PSResourceGet" -Repository 'localRepo' -Verbose + Write-Output "##vso[task.setvariable variable=publishPath;isOutput=true]$publishPath" displayName: Create nupkg for publishing + - pwsh: | + Set-Location '$(publishPath)' + Write-Host "Contents of signOutPath:" + Get-ChildItem '$(publishPath)' -Recurse + displayName: Find Nupkg Pre Signing + - task: onebranch.pipeline.signing@1 displayName: Sign nupkg inputs: command: 'sign' signing_profile: external_distribution files_to_sign: '**\*.nupkg' - search_root: "$(signOutPath)\PublishedNupkg" + search_root: '$(publishPath)' - pwsh: | - Set-Location "$(signOutPath)\PublishedNupkg" + Set-Location '$(publishPath)' Write-Host "Contents of signOutPath:" - Get-ChildItem "$(signOutPath)" -Recurse - displayName: Find Nupkg + Get-ChildItem '$(publishPath)' -Recurse + displayName: Find Nupkg Post Signing - task: CopyFiles@2 displayName: "Copy nupkg to ob_outputDirectory - '$(ob_outputDirectory)'" From 63b258a9e162c6b45977500ec4cbf4563dd67e8b Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Tue, 10 Mar 2026 23:02:24 +0000 Subject: [PATCH 2/3] Merged PR 38901: Remove isOutput on variable being set and update publishPath var reference Remove isOutput on variable being set and update publishPath var reference ---- #### AI description (iteration 1) #### PR Classification This pull request is a pipeline fix and code cleanup, adjusting variable setting and reference for improved consistency. #### PR Summary The changes remove the "isOutput=true" flag when setting the "publishPath" variable and update the file copy step to correctly reference the "publishPath". - `/.pipelines/PSResourceGet-Official.yml`: Removed the "isOutput=true" from the variable setting command. - `/.pipelines/PSResourceGet-Official.yml`: Updated the file copy task to use `publishPath` instead of `signOutPath` for selecting the published package. --- .pipelines/PSResourceGet-Official.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pipelines/PSResourceGet-Official.yml b/.pipelines/PSResourceGet-Official.yml index 9728e5b8a..8558e7d9a 100644 --- a/.pipelines/PSResourceGet-Official.yml +++ b/.pipelines/PSResourceGet-Official.yml @@ -240,7 +240,7 @@ extends: Register-PSResourceRepository -Name 'localRepo' -Uri $publishPath Publish-PSResource -Path "$(signOutPath)\Microsoft.PowerShell.PSResourceGet" -Repository 'localRepo' -Verbose - Write-Output "##vso[task.setvariable variable=publishPath;isOutput=true]$publishPath" + Write-Output "##vso[task.setvariable variable=publishPath]$publishPath" displayName: Create nupkg for publishing - pwsh: | @@ -266,7 +266,7 @@ extends: - task: CopyFiles@2 displayName: "Copy nupkg to ob_outputDirectory - '$(ob_outputDirectory)'" inputs: - Contents: $(signOutPath)\PublishedNupkg\Microsoft.PowerShell.PSResourceGet.*.nupkg + Contents: $(publishPath)\Microsoft.PowerShell.PSResourceGet.*.nupkg TargetFolder: $(ob_outputDirectory) - pwsh: | From 9289da13a78a05b08c53756194816cf79d4584c6 Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Wed, 11 Mar 2026 17:47:11 +0000 Subject: [PATCH 3/3] Merged PR 38916: Add ob_restore_phase to steps in packaging job Add ob_restore_phase to steps in packaging job --- .pipelines/PSResourceGet-Official.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.pipelines/PSResourceGet-Official.yml b/.pipelines/PSResourceGet-Official.yml index 8558e7d9a..e4ea3ba1e 100644 --- a/.pipelines/PSResourceGet-Official.yml +++ b/.pipelines/PSResourceGet-Official.yml @@ -209,6 +209,8 @@ extends: type: windows steps: - checkout: self + env: + ob_restore_phase: true # Set ob_restore_phase to run this step before '🔒 Setup Signing' step. - pwsh: | if (-not (Test-Path $(repoRoot)/.config/tsaoptions.json)) { @@ -216,18 +218,24 @@ extends: throw "tsaoptions.json does not exist under $(repoRoot)/.config" } displayName: Test if tsaoptions.json exists + env: + ob_restore_phase: true # Set ob_restore_phase to run this step before '🔒 Setup Signing' step. - task: DownloadPipelineArtifact@2 displayName: 'Download build files' inputs: targetPath: $(signOutPath) artifact: drop_stagebuild_jobbuild + env: + ob_restore_phase: true # Set ob_restore_phase to run this step before '🔒 Setup Signing' step. - pwsh: | Set-Location "$(signOutPath)" Write-Host "Contents of signOutPath:" Get-ChildItem $(signOutPath) -Recurse displayName: Capture artifacts directory structure + env: + ob_restore_phase: true # Set ob_restore_phase to run this step before '🔒 Setup Signing' step. - pwsh: | # This need to be done before set-location so the module from PSHome is loaded @@ -242,12 +250,16 @@ extends: Publish-PSResource -Path "$(signOutPath)\Microsoft.PowerShell.PSResourceGet" -Repository 'localRepo' -Verbose Write-Output "##vso[task.setvariable variable=publishPath]$publishPath" displayName: Create nupkg for publishing + env: + ob_restore_phase: true # Set ob_restore_phase to run this step before '🔒 Setup Signing' step. - pwsh: | Set-Location '$(publishPath)' Write-Host "Contents of signOutPath:" Get-ChildItem '$(publishPath)' -Recurse displayName: Find Nupkg Pre Signing + env: + ob_restore_phase: true # Set ob_restore_phase to run this step before '🔒 Setup Signing' step. - task: onebranch.pipeline.signing@1 displayName: Sign nupkg