@@ -209,55 +209,76 @@ extends:
209209 type : windows
210210 steps :
211211 - checkout : self
212+ env :
213+ ob_restore_phase : true # Set ob_restore_phase to run this step before '🔒 Setup Signing' step.
212214
213215 - pwsh : |
214216 if (-not (Test-Path $(repoRoot)/.config/tsaoptions.json)) {
215217 Get-ChildItem $(Build.SourcesDirectory) -recurse -ErrorAction SilentlyContinue
216218 throw "tsaoptions.json does not exist under $(repoRoot)/.config"
217219 }
218220 displayName: Test if tsaoptions.json exists
221+ env:
222+ ob_restore_phase: true # Set ob_restore_phase to run this step before '🔒 Setup Signing' step.
219223
220224 - task : DownloadPipelineArtifact@2
221225 displayName : ' Download build files'
222226 inputs :
223227 targetPath : $(signOutPath)
224228 artifact : drop_stagebuild_jobbuild
229+ env :
230+ ob_restore_phase : true # Set ob_restore_phase to run this step before '🔒 Setup Signing' step.
225231
226232 - pwsh : |
227233 Set-Location "$(signOutPath)"
228234 Write-Host "Contents of signOutPath:"
229235 Get-ChildItem $(signOutPath) -Recurse
230236 displayName: Capture artifacts directory structure
237+ env:
238+ ob_restore_phase: true # Set ob_restore_phase to run this step before '🔒 Setup Signing' step.
231239
232240 - pwsh : |
233241 # This need to be done before set-location so the module from PSHome is loaded
234242 Import-Module -Name Microsoft.PowerShell.PSResourceGet -Force
235243
236244 Set-Location "$(signOutPath)\Microsoft.PowerShell.PSResourceGet"
237- $null = New-Item -ItemType Directory - Path " $(signOutPath)\PublishedNupkg" -Force
245+ $publishPath = Join- Path $(signOutPath) -ChildPath 'PublishedNupkg'
238246
239- Register-PSResourceRepository -Name 'localRepo' -Uri "$(signOutPath)\PublishedNupkg"
247+ $null = New-Item -ItemType Directory -Path $publishPath -Force
248+
249+ Register-PSResourceRepository -Name 'localRepo' -Uri $publishPath
240250 Publish-PSResource -Path "$(signOutPath)\Microsoft.PowerShell.PSResourceGet" -Repository 'localRepo' -Verbose
251+ Write-Output "##vso[task.setvariable variable=publishPath]$publishPath"
241252 displayName: Create nupkg for publishing
253+ env:
254+ ob_restore_phase: true # Set ob_restore_phase to run this step before '🔒 Setup Signing' step.
255+
256+ - pwsh : |
257+ Set-Location '$(publishPath)'
258+ Write-Host "Contents of signOutPath:"
259+ Get-ChildItem '$(publishPath)' -Recurse
260+ displayName: Find Nupkg Pre Signing
261+ env:
262+ ob_restore_phase: true # Set ob_restore_phase to run this step before '🔒 Setup Signing' step.
242263
243264 - task : onebranch.pipeline.signing@1
244265 displayName : Sign nupkg
245266 inputs :
246267 command : ' sign'
247268 signing_profile : external_distribution
248269 files_to_sign : ' **\*.nupkg'
249- search_root : " $(signOutPath) \P ublishedNupkg "
270+ search_root : ' $(publishPath) '
250271
251272 - pwsh : |
252- Set-Location "$(signOutPath)\PublishedNupkg"
273+ Set-Location '$(publishPath)'
253274 Write-Host "Contents of signOutPath:"
254- Get-ChildItem "$(signOutPath)" -Recurse
255- displayName: Find Nupkg
275+ Get-ChildItem '$(publishPath)' -Recurse
276+ displayName: Find Nupkg Post Signing
256277
257278 - task : CopyFiles@2
258279 displayName : " Copy nupkg to ob_outputDirectory - '$(ob_outputDirectory)'"
259280 inputs :
260- Contents : $(signOutPath)\PublishedNupkg \Microsoft.PowerShell.PSResourceGet.*.nupkg
281+ Contents : $(publishPath) \Microsoft.PowerShell.PSResourceGet.*.nupkg
261282 TargetFolder : $(ob_outputDirectory)
262283
263284 - pwsh : |
0 commit comments