Skip to content

Commit 9a24c68

Browse files
committed
sbom changes
1 parent b74f202 commit 9a24c68

File tree

1 file changed

+53
-41
lines changed

1 file changed

+53
-41
lines changed

.pipelines/OSS_Microsoft_PSSA-Official.yml

Lines changed: 53 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ extends:
3131
parameters:
3232
customTags: 'ES365AIMigrationTooling'
3333
globalSdl:
34+
disableLegacyManifest: true
3435
sbom:
35-
enabled: false
36+
enabled: true
37+
packageName: Microsoft.PowerShell.ScriptAnalyzer
3638
codeql:
3739
compiled:
3840
enabled: true
@@ -48,13 +50,12 @@ extends:
4850
enabled: false
4951

5052
stages:
51-
- stage: Build
52-
displayName: Build
53+
- stage: stagebuild
54+
displayName: Build Files
5355
jobs:
54-
- job: Build_Job
55-
displayName: Build Microsoft.PowerShell.ScriptAnalyzer
56+
- job: jobbuild
57+
displayName: Build Microsoft.PowerShell.ScriptAnalyzer Files
5658
variables:
57-
- group: ESRP
5859
- name: ob_outputDirectory
5960
value: '$(Build.ArtifactStagingDirectory)/ONEBRANCH_ARTIFACT'
6061
- name: repoRoot
@@ -110,6 +111,8 @@ extends:
110111
$moduleData = Import-PowerShellDataFile "$(Build.SourcesDirectory)/OSS_Microsoft_PSSA/Engine/PSScriptAnalyzer.psd1"
111112
$moduleVersion = $moduleData.ModuleVersion
112113
$vstsCommandString = "vso[task.setvariable variable=moduleVersion]${moduleVersion}"
114+
$vstsCommandString = "vso[task.setvariable variable=ob_sdl_sbom_packageversion]${moduleVersion}"
115+
113116
Write-Host "sending $vstsCommandString"
114117
Write-Host "##$vstsCommandString"
115118
displayName: Setup variables for signing
@@ -118,59 +121,68 @@ extends:
118121
displayName: 'Sign the build output'
119122
inputs:
120123
command: 'sign'
121-
cp_code: 'CP-230012'
124+
signing_profile: external_distribution
122125
files_to_sign: '**\*.psd1;**\*.psm1;**\*.ps1xml;**\Microsoft*.dll'
123126
search_root: $(signSrcPath)
124127

125128
- task: onebranch.pipeline.signing@1
126129
displayName: 'Sign the build output'
127130
inputs:
128131
command: 'sign'
129-
cp_code: 'CP-231522'
132+
signing_profile: 135020002
130133
files_to_sign: '**/Pluralize*.dll;**/Newtonsoft*.dll'
131134
search_root: $(signSrcPath)
132135

133-
# - template: EsrpSign.yml@ComplianceRepo
134-
# parameters:
135-
# buildOutputPath: $(signSrcPath)
136-
# signOutputPath: $(signOutStep1)
137-
# certificateId: "CP-230012"
138-
# useMinimatch: true
139-
# pattern: |
140-
# **\*.psd1
141-
# **\*.psm1
142-
# **\*.ps1xml
143-
# **\Microsoft*.dll
136+
- task: CopyFiles@2
137+
displayName: "Copy Files for 'publish build directory' publish task"
138+
inputs:
139+
SourceFolder: "$(Build.SourcesDirectory)/OSS_Microsoft_PSSA"
140+
Contents: '**'
141+
TargetFolder: $(Build.ArtifactStagingDirectory)/ONEBRANCH_ARTIFACT
144142

145-
# - template: EsrpSign.yml@ComplianceRepo
146-
# parameters:
147-
# buildOutputPath: $(signOutStep1)
148-
# signOutputPath: $(signOutPath)
149-
# certificateId: "CP-231522"
150-
# useMinimatch: true
151-
# pattern: |
152-
# **/Pluralize*.dll
153-
# **/Newtonsoft*.dll
143+
- job: nupkg
144+
displayName: Package Microsoft.PowerShell.ScriptAnalyzer
145+
variables:
146+
- name: ob_outputDirectory
147+
value: '$(Build.ArtifactStagingDirectory)/ONEBRANCH_ARTIFACT'
148+
- name: repoRoot
149+
value: $(Build.SourcesDirectory)\OSS_Microsoft_PSSA
150+
- name: ob_sdl_tsa_configFile
151+
value: $(Build.SourcesDirectory)\OSS_Microsoft_PSSA\.config\tsaoptions.json
152+
- name: ob_sdl_sbom_enabled
153+
value: false
154+
- name: ob_sdl_codeql_compiled_enabled
155+
value: false
156+
pool:
157+
type: windows
158+
steps:
159+
- checkout: self
160+
- checkout: ComplianceRepo
154161

155-
- template: Sbom.yml@ComplianceRepo
156-
parameters:
157-
BuildDropPath: $(signOutPath)
158-
Build_Repository_Uri: 'https://github.com/powershell/PSScriptAnalyzer'
162+
- pwsh: |
163+
if (-not (Test-Path $(repoRoot)/.config/tsaoptions.json)) {
164+
Get-ChildItem $(Build.SourcesDirectory) -recurse -ErrorAction SilentlyContinue
165+
throw "tsaoptions.json does not exist under $(Build.SourcesDirectory)/OSS_Microsoft_PSSA/.config"
166+
}
167+
displayName: Test if tsaoptions.json exists
159168
169+
- task: DownloadPipelineArtifact@2
170+
displayName: 'Download build files'
171+
inputs:
172+
targetPath: $(Build.SourcesDirectory)/artifacts/build
173+
## download
160174
- pwsh: |
161-
Set-Location "$(Build.SourcesDirectory)/OSS_Microsoft_PSSA"
175+
Set-Location "$(Build.SourcesDirectory)/artifacts/"
176+
dir -recurse *
177+
displayName: Capture artifacts
178+
179+
- pwsh: |
180+
Set-Location "$(Build.SourcesDirectory)/artifacts/build"
162181
./build -BuildNupkg -CopyManifest -signed
163182
displayName: Create nupkg for publishing
164183
165-
- task: CopyFiles@2
166-
displayName: "Copy Files for 'publish build directory' publish task"
167-
inputs:
168-
SourceFolder: "$(Build.SourcesDirectory)/OSS_Microsoft_PSSA"
169-
Contents: '**'
170-
TargetFolder: $(Build.ArtifactStagingDirectory)/ONEBRANCH_ARTIFACT/build
171-
172184
- task: CopyFiles@2
173185
displayName: "Copy Files for 'Publish module nupkg' publish task"
174186
inputs:
175187
Contents: "$(signOutPath)/PSScriptAnalyzer.$(moduleVersion).nupkg"
176-
TargetFolder: $(Build.ArtifactStagingDirectory)/ONEBRANCH_ARTIFACT/nupkg
188+
TargetFolder: $(Build.ArtifactStagingDirectory)/ONEBRANCH_ARTIFACT

0 commit comments

Comments
 (0)