@@ -31,8 +31,10 @@ extends:
31
31
parameters :
32
32
customTags : ' ES365AIMigrationTooling'
33
33
globalSdl :
34
+ disableLegacyManifest : true
34
35
sbom :
35
- enabled : false
36
+ enabled : true
37
+ packageName : Microsoft.PowerShell.ScriptAnalyzer
36
38
codeql :
37
39
compiled :
38
40
enabled : true
@@ -48,13 +50,12 @@ extends:
48
50
enabled : false
49
51
50
52
stages :
51
- - stage : Build
52
- displayName : Build
53
+ - stage : stagebuild
54
+ displayName : Build Files
53
55
jobs :
54
- - job : Build_Job
55
- displayName : Build Microsoft.PowerShell.ScriptAnalyzer
56
+ - job : jobbuild
57
+ displayName : Build Microsoft.PowerShell.ScriptAnalyzer Files
56
58
variables :
57
- - group : ESRP
58
59
- name : ob_outputDirectory
59
60
value : ' $(Build.ArtifactStagingDirectory)/ONEBRANCH_ARTIFACT'
60
61
- name : repoRoot
@@ -110,6 +111,8 @@ extends:
110
111
$moduleData = Import-PowerShellDataFile "$(Build.SourcesDirectory)/OSS_Microsoft_PSSA/Engine/PSScriptAnalyzer.psd1"
111
112
$moduleVersion = $moduleData.ModuleVersion
112
113
$vstsCommandString = "vso[task.setvariable variable=moduleVersion]${moduleVersion}"
114
+ $vstsCommandString = "vso[task.setvariable variable=ob_sdl_sbom_packageversion]${moduleVersion}"
115
+
113
116
Write-Host "sending $vstsCommandString"
114
117
Write-Host "##$vstsCommandString"
115
118
displayName: Setup variables for signing
@@ -118,59 +121,68 @@ extends:
118
121
displayName : ' Sign the build output'
119
122
inputs :
120
123
command : ' sign'
121
- cp_code : ' CP-230012 '
124
+ signing_profile : external_distribution
122
125
files_to_sign : ' **\*.psd1;**\*.psm1;**\*.ps1xml;**\Microsoft*.dll'
123
126
search_root : $(signSrcPath)
124
127
125
128
- task : onebranch.pipeline.signing@1
126
129
displayName : ' Sign the build output'
127
130
inputs :
128
131
command : ' sign'
129
- cp_code : ' CP-231522 '
132
+ signing_profile : 135020002
130
133
files_to_sign : ' **/Pluralize*.dll;**/Newtonsoft*.dll'
131
134
search_root : $(signSrcPath)
132
135
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
144
142
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
154
161
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
159
168
169
+ - task : DownloadPipelineArtifact@2
170
+ displayName : ' Download build files'
171
+ inputs :
172
+ targetPath : $(Build.SourcesDirectory)/artifacts/build
173
+ # # download
160
174
- 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"
162
181
./build -BuildNupkg -CopyManifest -signed
163
182
displayName: Create nupkg for publishing
164
183
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
-
172
184
- task : CopyFiles@2
173
185
displayName : " Copy Files for 'Publish module nupkg' publish task"
174
186
inputs :
175
187
Contents : " $(signOutPath)/PSScriptAnalyzer.$(moduleVersion).nupkg"
176
- TargetFolder : $(Build.ArtifactStagingDirectory)/ONEBRANCH_ARTIFACT/nupkg
188
+ TargetFolder : $(Build.ArtifactStagingDirectory)/ONEBRANCH_ARTIFACT
0 commit comments