Skip to content

Commit 97ad0c2

Browse files
Publish symbols to symbols server for pwrshplugin.dll (#81)
1 parent 254dbf2 commit 97ad0c2

File tree

2 files changed

+84
-2
lines changed

2 files changed

+84
-2
lines changed

tools/releaseBuild/yaml/releaseBuild.yml

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

1214
resources:
1315
repositories:
@@ -105,6 +107,54 @@ stages:
105107
steps:
106108
- template: nuget.yml
107109

110+
- stage: PublishSymbol
111+
displayName: Publish pwrshplugin symbols
112+
dependsOn: Build
113+
jobs:
114+
- job: Symbols_Job
115+
pool:
116+
name: PowerShell1ES
117+
demands:
118+
- ImageOverride -equals PSMMS2019-PS-Native-Secure
119+
steps:
120+
- download: current
121+
artifact: release
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 { $_.Name -like 'x*-symbols.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/$($destFolder.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

tools/releaseBuild/yaml/upload.yml

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,44 @@ parameters:
33
sourcePath: ''
44

55
steps:
6+
7+
- powershell: |
8+
[System.Net.ServicePointManager]::SecurityProtocol =
9+
[System.Net.ServicePointManager]::SecurityProtocol -bor
10+
[System.Security.Authentication.SslProtocols]::Tls12 -bor
11+
[System.Security.Authentication.SslProtocols]::Tls11
12+
13+
Get-PackageProvider -Name NuGet -ForceBootstrap
14+
Install-Module PowerShellGet -RequiredVersion 2.2.5 -SkipPublisherCheck -Force
15+
displayName: Update PowerShell Get
16+
17+
- powershell: |
18+
$modules = 'Az.Accounts', 'Az.Storage', 'Az.Resources'
19+
foreach($module in $modules) {
20+
if(!(get-module $module -listavailable)) {
21+
Write-Verbose "installing $module..." -verbose
22+
Install-Module $module -force -AllowClobber
23+
} else {
24+
#Write-Verbose "updating $module..." -verbose
25+
#Update-Module $module -verbose
26+
}
27+
}
28+
displayName: Install PowerShell modules
29+
30+
- powershell: |
31+
$azureRMModule = Get-Module -Name AzureRM -ListAvailable -ErrorAction SilentlyContinue
32+
if ($azureRMModule) {
33+
Uninstall-AzureRm
34+
}
35+
displayName: Uninstall Uninstall-AzureRm
36+
continueOnError: true
37+
638
- task: AzureFileCopy@4
739
displayName: 'Upload ${{ parameters.fileName }} to azure blob'
840
inputs:
941
SourcePath: '${{ parameters.sourcePath }}'
10-
azureSubscription: 'MGMT-Powershell-CICDInfra (94cf12ad-4fe9-490b-b281-0a260198a4e0)'
42+
azureSubscription: '$(AzureFileCopySubscription)'
1143
Destination: AzureBlob
12-
storage: pscoretestdata
44+
storage: '$(StorageAccount)'
1345
ContainerName: 'PowerShell-Native-Symbols'
1446
BlobPrefix: '$(Build.SourceBranchName)'

0 commit comments

Comments
 (0)