Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish symbol for Microsoft.PowerShell.PSResourceGet to Microsoft symbol server #1434

Merged
merged 38 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
bef1f09
add stage to publish symbols to symbol server
anamnavi Sep 19, 2023
21e2ba1
add newline
anamnavi Sep 19, 2023
2443cf5
add logging command to upload pdb file
anamnavi Sep 20, 2023
df55b07
reference symbol file name
anamnavi Sep 24, 2023
53784f6
remove code from ci_release
anamnavi Sep 24, 2023
981801c
use Microsoft.Powershell.PSResourceGet in CI as we released a new Pow…
anamnavi Sep 24, 2023
fa6fd10
debug test.yml
anamnavi Sep 24, 2023
f774aec
debug config name
anamnavi Sep 24, 2023
af62a22
check what local repo contains
anamnavi Sep 24, 2023
4999fd4
add recurse
anamnavi Sep 24, 2023
7822717
perform find
anamnavi Sep 24, 2023
36a95ba
add prerelease param
anamnavi Sep 24, 2023
b463dad
add verbose statements
anamnavi Sep 25, 2023
e644b63
PackagePath is a URI
anamnavi Sep 25, 2023
9f9dfce
rmeove verbose statements
anamnavi Sep 25, 2023
bd46ade
add verbose to find
anamnavi Sep 25, 2023
f4dd62e
add verbose to find
anamnavi Sep 25, 2023
3a583e9
add debug and try nupkg folder
anamnavi Sep 25, 2023
4a3d9a5
specify nupkg folder in repo URI
anamnavi Sep 25, 2023
5e331ef
remove find code
anamnavi Sep 25, 2023
d1687f1
add TrustRepository
anamnavi Sep 25, 2023
c2f24b0
add code to upload pdb
anamnavi Sep 25, 2023
6dfb572
update ADO error code
anamnavi Sep 25, 2023
080907f
fix publish symbols job
anamnavi Sep 25, 2023
c14f33b
fix publish symbols job
anamnavi Sep 25, 2023
4cd325c
Merge branch 'master' of https://github.com/anamnavi/PowerShellGet in…
anamnavi Sep 26, 2023
2c37f42
remove ToString() call
anamnavi Sep 26, 2023
c095d4d
remove publish condition for symbols to test
anamnavi Oct 4, 2023
9950342
fix artifact name
anamnavi Oct 4, 2023
20aa8e1
fix artifact name and add pattern
anamnavi Oct 4, 2023
66dc78f
fix upload artifact step
anamnavi Oct 4, 2023
dbd690e
change Copy-Item to Move-Item as pdb does not need to be published
anamnavi Oct 4, 2023
c3d4ced
log vso string
anamnavi Oct 4, 2023
1c29e76
rename artifact and folders
anamnavi Oct 4, 2023
af055e7
fix error in artifact.upload
anamnavi Oct 4, 2023
44cc36c
update verbose messages
anamnavi Oct 5, 2023
6c92b81
add variable group reference to ci_release.yml
anamnavi Oct 5, 2023
a5735e7
code cleanup
anamnavi Oct 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading