diff --git a/.pipelines/PSResourceGet-Official.yml b/.pipelines/PSResourceGet-Official.yml index e4ea3ba1e..a44d53651 100644 --- a/.pipelines/PSResourceGet-Official.yml +++ b/.pipelines/PSResourceGet-Official.yml @@ -209,8 +209,6 @@ 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)) { @@ -218,48 +216,29 @@ 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 Import-Module -Name Microsoft.PowerShell.PSResourceGet -Force Set-Location "$(signOutPath)\Microsoft.PowerShell.PSResourceGet" - $publishPath = Join-Path $(signOutPath) -ChildPath 'PublishedNupkg' + $null = New-Item -ItemType Directory -Path "$(signOutPath)\PublishedNupkg" -Force - $null = New-Item -ItemType Directory -Path $publishPath -Force - - Register-PSResourceRepository -Name 'localRepo' -Uri $publishPath + Register-PSResourceRepository -Name 'localRepo' -Uri "$(signOutPath)\PublishedNupkg" 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 @@ -267,18 +246,18 @@ extends: command: 'sign' signing_profile: external_distribution files_to_sign: '**\*.nupkg' - search_root: '$(publishPath)' + search_root: "$(signOutPath)\PublishedNupkg" - pwsh: | - Set-Location '$(publishPath)' + Set-Location "$(signOutPath)\PublishedNupkg" Write-Host "Contents of signOutPath:" - Get-ChildItem '$(publishPath)' -Recurse - displayName: Find Nupkg Post Signing + Get-ChildItem "$(signOutPath)" -Recurse + displayName: Find Nupkg - task: CopyFiles@2 displayName: "Copy nupkg to ob_outputDirectory - '$(ob_outputDirectory)'" inputs: - Contents: $(publishPath)\Microsoft.PowerShell.PSResourceGet.*.nupkg + Contents: $(signOutPath)\PublishedNupkg\Microsoft.PowerShell.PSResourceGet.*.nupkg TargetFolder: $(ob_outputDirectory) - pwsh: |