Skip to content

Commit a16d3f4

Browse files
committed
Add SBOM to deployables pipeline artifact
This is required for consumption from production release jobs.
1 parent a880a38 commit a16d3f4

2 files changed

Lines changed: 38 additions & 23 deletions

File tree

azure-pipelines/build.yml

Lines changed: 37 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,17 @@ parameters:
2929
- name: artifact_names
3030
type: object
3131
default:
32-
- build_logs
33-
- coverageResults
34-
- deployables
35-
- projectAssetsJson
36-
- symbols
37-
- testResults
38-
- test_symbols
39-
- Variables
32+
- name: build_logs
33+
- name: coverageResults
34+
- name: deployables
35+
sbomEnabled: true
36+
- name: projectAssetsJson
37+
- name: symbols
38+
- name: testResults
39+
testOnly: true
40+
- name: test_symbols
41+
testOnly: true
42+
- name: Variables
4043
# The Enable*Build parameters turn non-Windows agents on or off.
4144
# Their default value should be based on whether the build and tests are expected/required to pass on that platform.
4245
# Callers (e.g. Official.yml) *may* expose these parameters at queue-time in order to turn OFF optional agents.
@@ -57,6 +60,11 @@ parameters:
5760
- name: Is1ESPT
5861
type: boolean
5962

63+
# Indicates whether the 'official' 1ES PT templates are being used (as opposed to the unofficial ones).
64+
- name: Is1ESPTOfficial
65+
type: boolean
66+
default: false
67+
6068
- name: RealSign
6169
type: boolean
6270
default: false
@@ -148,12 +156,14 @@ jobs:
148156

149157
outputParentDirectory: $(Build.ArtifactStagingDirectory)
150158
outputs:
151-
- ${{ each artifact_name in parameters.artifact_names }}:
152-
- ${{ if or(ne(artifact_name, 'testResults'), parameters.RunTests) }}:
159+
- ${{ each artifact in parameters.artifact_names }}:
160+
- ${{ if or(ne(artifact.testOnly, 'true'), parameters.RunTests) }}:
153161
- output: pipelineArtifact
154-
displayName: 📢 Publish ${{ artifact_name }}-Windows
155-
targetPath: $(Build.ArtifactStagingDirectory)/${{ artifact_name }}-Windows
156-
artifactName: ${{ artifact_name }}-Windows
162+
displayName: 📢 Publish ${{ artifact.name }}-Windows
163+
targetPath: $(Build.ArtifactStagingDirectory)/${{ artifact.name }}-Windows
164+
artifactName: ${{ artifact.name }}-Windows
165+
${{ if and(parameters.Is1ESPTOfficial, eq(artifact.sbomEnabled, 'true')) }}:
166+
sbomEnabled: true
157167
condition: succeededOrFailed()
158168
- output: pipelineArtifact
159169
displayName: 📢 Publish VSInsertion-Windows
@@ -229,12 +239,14 @@ jobs:
229239
signWithProd: true
230240
outputParentDirectory: $(Build.ArtifactStagingDirectory)
231241
outputs:
232-
- ${{ each artifact_name in parameters.artifact_names }}:
233-
- ${{ if or(ne(artifact_name, 'testResults'), parameters.RunTests) }}:
242+
- ${{ each artifact in parameters.artifact_names }}:
243+
- ${{ if or(ne(artifact.testOnly, 'true'), parameters.RunTests) }}:
234244
- output: pipelineArtifact
235-
displayName: 📢 Publish ${{ artifact_name }}-Linux
236-
targetPath: $(Build.ArtifactStagingDirectory)/${{ artifact_name }}-Linux
237-
artifactName: ${{ artifact_name }}-Linux
245+
displayName: 📢 Publish ${{ artifact.name }}-Linux
246+
targetPath: $(Build.ArtifactStagingDirectory)/${{ artifact.name }}-Linux
247+
artifactName: ${{ artifact.name }}-Linux
248+
${{ if and(parameters.Is1ESPTOfficial, eq(artifact.sbomEnabled, 'true')) }}:
249+
sbomEnabled: true
238250
condition: succeededOrFailed()
239251
steps:
240252
- checkout: self
@@ -266,12 +278,14 @@ jobs:
266278
signWithProd: true
267279
outputParentDirectory: $(Build.ArtifactStagingDirectory)
268280
outputs:
269-
- ${{ each artifact_name in parameters.artifact_names }}:
270-
- ${{ if or(ne(artifact_name, 'testResults'), parameters.RunTests) }}:
281+
- ${{ each artifact in parameters.artifact_names }}:
282+
- ${{ if or(ne(artifact.testOnly, 'true'), parameters.RunTests) }}:
271283
- output: pipelineArtifact
272-
displayName: 📢 Publish ${{ artifact_name }}-macOS
273-
targetPath: $(Build.ArtifactStagingDirectory)/${{ artifact_name }}-macOS
274-
artifactName: ${{ artifact_name }}-macOS
284+
displayName: 📢 Publish ${{ artifact.name }}-macOS
285+
targetPath: $(Build.ArtifactStagingDirectory)/${{ artifact.name }}-macOS
286+
artifactName: ${{ artifact.name }}-macOS
287+
${{ if and(parameters.Is1ESPTOfficial, eq(artifact.sbomEnabled, 'true')) }}:
288+
sbomEnabled: true
275289
condition: succeededOrFailed()
276290
steps:
277291
- checkout: self

azure-pipelines/official.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ extends:
6868
- template: /azure-pipelines/build.yml@self
6969
parameters:
7070
Is1ESPT: true
71+
Is1ESPTOfficial: true
7172
RealSign: true
7273
# ShouldSkipOptimize: ${{ parameters.ShouldSkipOptimize }}
7374
EnableAPIScan: ${{ parameters.EnableAPIScan }}

0 commit comments

Comments
 (0)