Skip to content

Commit

Permalink
Publish symbol for Microsoft.PowerShell.PSResourceGet to Microsoft sy…
Browse files Browse the repository at this point in the history
…mbol server (#1434)
  • Loading branch information
anamnavi authored Oct 6, 2023
1 parent 152e570 commit 2efac58
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .ci/ci_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pr: none
variables:
- group: ESRP
- group: GithubTestingFeedCreds
- group: PSGetSymbol
# Prevents auto-injection of nuget-security-analysis (not needed for open source projects)
- name: skipNugetSecurityAnalysis
value: true
Expand Down Expand Up @@ -235,6 +236,15 @@ stages:
$vstsCommandString = "vso[task.setvariable variable=signOutPathCreated]${signOutPath}"
Write-Host "sending " + $vstsCommandString
Write-Host "##$vstsCommandString"
# Upload symbol pdb file
$moduleName = "$($config.ModuleName)"
$symbolFilePath = Join-Path -Path $srcPath -ChildPath "$moduleName.pdb"
$folderName = "symbolResult"
$artifactName = "symbolfile"
$vstsCommandString = "vso[artifact.upload containerfolder=${folderName};artifactname=${artifactName}]${symbolFilePath}"
Write-Host "sending " + $vstsCommandString
Write-Host "##$vstsCommandString"
displayName: Set up for module created files code signing
condition: and(and(succeeded(), eq(variables['Build.Reason'], 'Manual')), ne(variables['SkipSigning'], 'True'))
Expand Down Expand Up @@ -407,6 +417,12 @@ stages:
displayName: PowerShell Core on macOS
imageName: macOS-latest

- stage: PublishSymbols
displayName: Publish Symbols
condition: and(and(succeeded(), eq(variables['Build.Reason'], 'Manual')), eq(variables['Publish'], 'True'))
jobs:
- template: publishsymbols.yml

- stage: Release
displayName: Publish Package to PSGallery
condition: and(and(succeeded(), eq(variables['Build.Reason'], 'Manual')), eq(variables['Publish'], 'True'))
Expand Down
39 changes: 39 additions & 0 deletions .ci/publishsymbols.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
parameters:
jobName1: publish_symbols_job
displayValidationJob1: 'Publish symbol to Microsoft symbol server'

jobs:
- job: ${{ parameters.jobName1 }}
displayName: ${{ parameters.displayValidationJob1 }}
pool:
name: 1ES
demands:
- ImageOverride -equals PSMMS2019-Secure
timeoutInMinutes: 2880 # job times out in 2 days
steps:
- task: DownloadPipelineArtifact@2
displayName: 'Download and publish symbols'
inputs:
artifact: symbolfile
path: '$(Pipeline.Workspace)\symbolResult'
pattern: '**/*.pdb'

- pwsh: |
$symbolsRoot = New-Item -Path "$(Pipeline.Workspace)/symbols" -ItemType Directory -Verbose
Copy-Item -Path "$(Pipeline.Workspace)\symbolResult\Microsoft.PowerShell.PSResourceGet.pdb" -Destination $symbolsRoot
Write-Verbose -Verbose "Enumerating $symbolsRoot"
Get-ChildItem -Path $symbolsRoot -Recurse
$vstsCommandString = "vso[task.setvariable variable=SymbolsPath]$symbolsRoot"
Write-Verbose -Message "$vstsCommandString" -Verbose
Write-Host -Object "##$vstsCommandString"
displayName: Copy symbol file to path for task
- task: PublishSymbols@2
inputs:
symbolsFolder: '$(SymbolsPath)'
searchPattern: '*.pdb'
indexSources: false
publishSymbols: true
symbolServerType: teamServices
detailedLog: true

0 comments on commit 2efac58

Please sign in to comment.