Skip to content

Commit 2efac58

Browse files
authored
Publish symbol for Microsoft.PowerShell.PSResourceGet to Microsoft symbol server (#1434)
1 parent 152e570 commit 2efac58

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

.ci/ci_release.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ pr: none
55
variables:
66
- group: ESRP
77
- group: GithubTestingFeedCreds
8+
- group: PSGetSymbol
89
# Prevents auto-injection of nuget-security-analysis (not needed for open source projects)
910
- name: skipNugetSecurityAnalysis
1011
value: true
@@ -235,6 +236,15 @@ stages:
235236
$vstsCommandString = "vso[task.setvariable variable=signOutPathCreated]${signOutPath}"
236237
Write-Host "sending " + $vstsCommandString
237238
Write-Host "##$vstsCommandString"
239+
240+
# Upload symbol pdb file
241+
$moduleName = "$($config.ModuleName)"
242+
$symbolFilePath = Join-Path -Path $srcPath -ChildPath "$moduleName.pdb"
243+
$folderName = "symbolResult"
244+
$artifactName = "symbolfile"
245+
$vstsCommandString = "vso[artifact.upload containerfolder=${folderName};artifactname=${artifactName}]${symbolFilePath}"
246+
Write-Host "sending " + $vstsCommandString
247+
Write-Host "##$vstsCommandString"
238248
displayName: Set up for module created files code signing
239249
condition: and(and(succeeded(), eq(variables['Build.Reason'], 'Manual')), ne(variables['SkipSigning'], 'True'))
240250
@@ -407,6 +417,12 @@ stages:
407417
displayName: PowerShell Core on macOS
408418
imageName: macOS-latest
409419

420+
- stage: PublishSymbols
421+
displayName: Publish Symbols
422+
condition: and(and(succeeded(), eq(variables['Build.Reason'], 'Manual')), eq(variables['Publish'], 'True'))
423+
jobs:
424+
- template: publishsymbols.yml
425+
410426
- stage: Release
411427
displayName: Publish Package to PSGallery
412428
condition: and(and(succeeded(), eq(variables['Build.Reason'], 'Manual')), eq(variables['Publish'], 'True'))

.ci/publishsymbols.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
parameters:
2+
jobName1: publish_symbols_job
3+
displayValidationJob1: 'Publish symbol to Microsoft symbol server'
4+
5+
jobs:
6+
- job: ${{ parameters.jobName1 }}
7+
displayName: ${{ parameters.displayValidationJob1 }}
8+
pool:
9+
name: 1ES
10+
demands:
11+
- ImageOverride -equals PSMMS2019-Secure
12+
timeoutInMinutes: 2880 # job times out in 2 days
13+
steps:
14+
- task: DownloadPipelineArtifact@2
15+
displayName: 'Download and publish symbols'
16+
inputs:
17+
artifact: symbolfile
18+
path: '$(Pipeline.Workspace)\symbolResult'
19+
pattern: '**/*.pdb'
20+
21+
- pwsh: |
22+
$symbolsRoot = New-Item -Path "$(Pipeline.Workspace)/symbols" -ItemType Directory -Verbose
23+
Copy-Item -Path "$(Pipeline.Workspace)\symbolResult\Microsoft.PowerShell.PSResourceGet.pdb" -Destination $symbolsRoot
24+
25+
Write-Verbose -Verbose "Enumerating $symbolsRoot"
26+
Get-ChildItem -Path $symbolsRoot -Recurse
27+
$vstsCommandString = "vso[task.setvariable variable=SymbolsPath]$symbolsRoot"
28+
Write-Verbose -Message "$vstsCommandString" -Verbose
29+
Write-Host -Object "##$vstsCommandString"
30+
displayName: Copy symbol file to path for task
31+
32+
- task: PublishSymbols@2
33+
inputs:
34+
symbolsFolder: '$(SymbolsPath)'
35+
searchPattern: '*.pdb'
36+
indexSources: false
37+
publishSymbols: true
38+
symbolServerType: teamServices
39+
detailedLog: true

0 commit comments

Comments
 (0)