Skip to content

Commit 5d8b11e

Browse files
Add publish symbols stage
1 parent 2b6a8c7 commit 5d8b11e

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

tools/releaseBuild/yaml/releaseBuild.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ variables:
88
- name: PackageRoot
99
value: '$(System.ArtifactsDirectory)/Packages'
1010
- group: PSNativeAPIScan
11+
- group: SymbolPublish
1112

1213
resources:
1314
repositories:
@@ -105,6 +106,55 @@ stages:
105106
steps:
106107
- template: nuget.yml
107108

109+
- stage: PublishSymbol
110+
displayName: Publish pwrshplugin symbols
111+
dependsOn: Build
112+
jobs:
113+
- job: Symbols_Job
114+
pool:
115+
name: PowerShell1ES
116+
demands:
117+
- ImageOverride -equals PSMMS2019-PS-Native-Secure
118+
steps:
119+
- download: current
120+
artifact: release
121+
patterns: 'x*.zip'
122+
123+
- pwsh: |
124+
Write-Verbose -Verbose "Enumerating "$(Pipeline.Workspace)/release"
125+
$downloadedArtifacts = Get-ChildItem -Recurse "$(Pipeline.Workspace)/release"
126+
$downloadedArtifacts
127+
128+
$expandedRoot = New-Item -Path "$(Pipeline.Workspace)/expanded" -ItemType Directory -Verbose
129+
$symbolsRoot = New-Item -Path "$(Pipeline.Workspace)/symbols" -ItemType Directory -Verbose
130+
131+
$downloadedArtifacts | Where-Object { $_.Extension -eq 'zip' } | ForEach-Object {
132+
$destFolder = New-Item -Path "$expandedRoot/$($_.BaseName)/" -ItemType Directory -Verbose
133+
Expand-Archive -Path $_.FullName -DestinationPath $destFolder -Force
134+
135+
Get-ChildItem -Path $destFolder -Recurse -Filter *.pdb | ForEach-Object {
136+
$runtimeFolder = New-Item -Path "$symbolsRoot/$($_.BaseName)/" -ItemType Directory -Verbose
137+
Copy-Item -Path $_.FullName -Destination $runtimeFolder -Verbose
138+
}
139+
}
140+
141+
Write-Verbose -Verbose "Enumerating "$symbolsRoot"
142+
Get-ChildItem -Path $symbolsRoot -Recurse
143+
144+
$vstsCommandString = "vso[task.setvariable variable=SymbolsPath]$symbolsRoot"
145+
Write-Verbose -Message "$vstsCommandString" -Verbose
146+
Write-Host -Object "##$vstsCommandString"
147+
displayName: Expand and capture symbols folders
148+
149+
- task: PublishSymbols@2
150+
inputs:
151+
symbolsFolder: '$(SymbolsPath)'
152+
searchPattern: '**/*.pdb'
153+
indexSources: false
154+
publishSymbols: true
155+
symbolServerType: teamServices
156+
detailedLog: true
157+
108158
- stage: compliance
109159
displayName: Compliance
110160
dependsOn: Build

0 commit comments

Comments
 (0)