Skip to content

Commit 7095763

Browse files
author
Anam Navied
committed
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. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
1 parent f4bd328 commit 7095763

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

.pipelines/PSResourceGet-Official.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -234,25 +234,34 @@ extends:
234234
Import-Module -Name Microsoft.PowerShell.PSResourceGet -Force
235235
236236
Set-Location "$(signOutPath)\Microsoft.PowerShell.PSResourceGet"
237-
$null = New-Item -ItemType Directory -Path "$(signOutPath)\PublishedNupkg" -Force
237+
$publishPath = Join-Path $(signOutPath) -ChildPath 'PublishedNupkg'
238238
239-
Register-PSResourceRepository -Name 'localRepo' -Uri "$(signOutPath)\PublishedNupkg"
239+
$null = New-Item -ItemType Directory -Path $publishPath -Force
240+
241+
Register-PSResourceRepository -Name 'localRepo' -Uri $publishPath
240242
Publish-PSResource -Path "$(signOutPath)\Microsoft.PowerShell.PSResourceGet" -Repository 'localRepo' -Verbose
243+
Write-Output "##vso[task.setvariable variable=publishPath;isOutput=true]$publishPath"
241244
displayName: Create nupkg for publishing
242245
246+
- pwsh: |
247+
Set-Location '$(publishPath)'
248+
Write-Host "Contents of signOutPath:"
249+
Get-ChildItem '$(publishPath)' -Recurse
250+
displayName: Find Nupkg Pre Signing
251+
243252
- task: onebranch.pipeline.signing@1
244253
displayName: Sign nupkg
245254
inputs:
246255
command: 'sign'
247256
signing_profile: external_distribution
248257
files_to_sign: '**\*.nupkg'
249-
search_root: "$(signOutPath)\PublishedNupkg"
258+
search_root: '$(publishPath)'
250259

251260
- pwsh: |
252-
Set-Location "$(signOutPath)\PublishedNupkg"
261+
Set-Location '$(publishPath)'
253262
Write-Host "Contents of signOutPath:"
254-
Get-ChildItem "$(signOutPath)" -Recurse
255-
displayName: Find Nupkg
263+
Get-ChildItem '$(publishPath)' -Recurse
264+
displayName: Find Nupkg Post Signing
256265
257266
- task: CopyFiles@2
258267
displayName: "Copy nupkg to ob_outputDirectory - '$(ob_outputDirectory)'"

0 commit comments

Comments
 (0)