From 920ca2cd47e584b57e05777a5e1b7ce7c7046af5 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Wed, 2 Oct 2024 16:08:06 -0700 Subject: [PATCH] Release SBOM (#4201) --- .pipelines/PSReadLine-Official.yml | 37 ++++++++++++++---------------- MockPSConsole/MockPSConsole.csproj | 2 +- PSReadLine/PSReadLine.csproj | 2 +- Polyfill/Polyfill.csproj | 2 +- test/PSReadLine.Tests.csproj | 2 +- tools/helper.psm1 | 2 +- 6 files changed, 22 insertions(+), 25 deletions(-) diff --git a/.pipelines/PSReadLine-Official.yml b/.pipelines/PSReadLine-Official.yml index cbbcb701..1308f963 100644 --- a/.pipelines/PSReadLine-Official.yml +++ b/.pipelines/PSReadLine-Official.yml @@ -15,21 +15,22 @@ pr: none variables: DOTNET_CLI_TELEMETRY_OPTOUT: 1 POWERSHELL_TELEMETRY_OPTOUT: 1 - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 + DOTNET_NOLOGO: 1 WindowsContainerImage: onebranch.azurecr.io/windows/ltsc2022/vse2022:latest resources: repositories: - - repository: onebranchTemplates - type: git - name: OneBranch.Pipelines/GovernedTemplates - ref: refs/heads/main + - repository: templates + type: git + name: OneBranch.Pipelines/GovernedTemplates + ref: refs/heads/main extends: - template: v2/OneBranch.Official.CrossPlat.yml@onebranchTemplates + template: v2/OneBranch.Official.CrossPlat.yml@templates parameters: featureFlags: - WindowsHostVersion: '1ESWindows2022' + WindowsHostVersion: + Version: 2022 globalSdl: disableLegacyManifest: true cg: # Component Governance parameters. Ignore test components. @@ -43,7 +44,7 @@ extends: enabled: true asyncSdl: # https://aka.ms/obpipelines/asyncsdl enabled: true - forStages: [Build] + forStages: [buildstage] credscan: enabled: true scanFolder: $(Build.SourcesDirectory)\PSReadLine\PSReadLine @@ -154,7 +155,7 @@ extends: } Write-Host "Display files in the folder ..." -ForegroundColor Yellow - Get-ChildItem -Path $(signSrcPath) -Recurse | Out-String -Width 120 + Get-ChildItem -Path $(signSrcPath) -Recurse | Out-String -Width 120 -Stream displayName: 'Verify the signed files' - task: CopyFiles@2 @@ -212,7 +213,11 @@ extends: artifact: drop_buildstage_buildjob - pwsh: | - Get-ChildItem $(signOutPath) -Recurse + if (Test-Path '$(signOutPath)\_manifest') { + Write-Verbose -Verbose "Delete SBOM files ..." + Remove-Item -Path '$(signOutPath)\_manifest' -Recurse -Force + } + Get-ChildItem $(signOutPath) -Recurse | Out-String -Width 120 -Stream New-Item -Path $(nugetPath) -ItemType Directory > $null displayName: Capture artifacts structure env: @@ -226,7 +231,7 @@ extends: } finally { Unregister-PSRepository -Name $RepoName -ErrorAction SilentlyContinue } - Get-ChildItem -Path $(nugetPath) + Get-ChildItem -Path $(nugetPath) | Out-String -Width 120 -Stream displayName: 'Create the NuGet package' env: ob_restore_phase: true # This ensures this done in restore phase to workaround signing issue @@ -290,17 +295,9 @@ extends: artifact: drop_buildstage_nupkg - pwsh: | - Get-ChildItem $(nugetPath) -Recurse + Get-ChildItem $(nugetPath) -Recurse | Out-String -Width 120 -Stream displayName: Find signed Nupkg - - task: NuGetCommand@2 - displayName: Push PSReadLine module to Azure feed - inputs: - command: push - packagesToPush: $(nugetPath)\PSReadLine.*.nupkg - nuGetFeedType: external - publishFeedCredentials: AzArtifactsFeed - - task: NuGetCommand@2 displayName: Push PSReadLine module to PSGallery feed inputs: diff --git a/MockPSConsole/MockPSConsole.csproj b/MockPSConsole/MockPSConsole.csproj index 8c66078c..725855d7 100644 --- a/MockPSConsole/MockPSConsole.csproj +++ b/MockPSConsole/MockPSConsole.csproj @@ -18,7 +18,7 @@ - + diff --git a/PSReadLine/PSReadLine.csproj b/PSReadLine/PSReadLine.csproj index d8168a80..0e28e36e 100644 --- a/PSReadLine/PSReadLine.csproj +++ b/PSReadLine/PSReadLine.csproj @@ -22,7 +22,7 @@ - + diff --git a/Polyfill/Polyfill.csproj b/Polyfill/Polyfill.csproj index a1a1693c..86a62ad3 100644 --- a/Polyfill/Polyfill.csproj +++ b/Polyfill/Polyfill.csproj @@ -12,7 +12,7 @@ - + diff --git a/test/PSReadLine.Tests.csproj b/test/PSReadLine.Tests.csproj index f7d69cd7..465743ec 100644 --- a/test/PSReadLine.Tests.csproj +++ b/test/PSReadLine.Tests.csproj @@ -24,7 +24,7 @@ - + diff --git a/tools/helper.psm1 b/tools/helper.psm1 index b8056de6..a3ee18a8 100644 --- a/tools/helper.psm1 +++ b/tools/helper.psm1 @@ -1,5 +1,5 @@ -$MinimalSDKVersion = '6.0.100' +$MinimalSDKVersion = '6.0.425' $IsWindowsEnv = [System.Environment]::OSVersion.Platform -eq "Win32NT" $RepoRoot = (Resolve-Path "$PSScriptRoot/..").Path $LocalDotnetDirPath = if ($IsWindowsEnv) { "$env:LocalAppData\Microsoft\dotnet" } else { "$env:HOME/.dotnet" }