File tree 3 files changed +23
-12
lines changed 3 files changed +23
-12
lines changed Original file line number Diff line number Diff line change @@ -627,12 +627,16 @@ def create_sbom_for_windows_artifact(exe_path):
627
627
628
628
629
629
def main () -> None :
630
- artifact_path = sys .argv [1 ]
631
- if artifact_path .endswith (".exe" ):
632
- sbom_data = create_sbom_for_windows_artifact (artifact_path )
633
- else :
634
- sbom_data = create_sbom_for_source_tarball (artifact_path )
635
- print (json .dumps (sbom_data , indent = 2 , sort_keys = True ))
630
+ artifact_paths = sys .argv [1 :]
631
+ for artifact_path in artifact_paths :
632
+ if artifact_path .endswith (".exe" ):
633
+ sbom_data = create_sbom_for_windows_artifact (artifact_path )
634
+ else :
635
+ sbom_data = create_sbom_for_source_tarball (artifact_path )
636
+
637
+ with open (artifact_path + ".spdx.json" , mode = "w" ) as f :
638
+ f .truncate ()
639
+ print (json .dumps (sbom_data , indent = 2 , sort_keys = True ))
636
640
637
641
638
642
if __name__ == "__main__" :
Original file line number Diff line number Diff line change @@ -224,7 +224,7 @@ stages:
224
224
- ${{ if eq(parameters.DoMSI, 'true') }} :
225
225
- stage : PublishPyDotOrg
226
226
displayName : Publish to python.org
227
- dependsOn : ['SBOM', ' Test_MSI', 'Test']
227
+ dependsOn : ['Test_MSI', 'Test']
228
228
jobs :
229
229
- template : stage-publish-pythonorg.yml
230
230
Original file line number Diff line number Diff line change @@ -34,12 +34,19 @@ jobs:
34
34
- powershell : >
35
35
python
36
36
"$(Build.SourcesDirectory)\sbom.py"
37
- (gci msi\*\python-*.exe | select -First 1 )
37
+ (gci msi\*\python-*.exe)
38
38
workingDirectory: $(Build.BinariesDirectory)
39
39
displayName: 'Create SBOMs for binaries'
40
40
41
- - task : PublishPipelineArtifact@0
42
- displayName : ' Publish artifact : sbom'
41
+ - task : CopyFiles@2
42
+ displayName : ' Layout Artifact : sbom'
43
43
inputs :
44
- targetPath : ' $(Build.BinariesDirectory)\sbom'
45
- artifactName : sbom
44
+ sourceFolder : $(Build.BinariesDirectory)\bin
45
+ targetFolder : $(Build.ArtifactStagingDirectory)\sbom
46
+ flatten : true
47
+ contents : |
48
+ **\*.spdx.json
49
+
50
+ - publish : ' $(Build.ArtifactStagingDirectory)\sbom'
51
+ artifact : sbom
52
+ displayName : ' Publish artifact: sbom'
You can’t perform that action at this time.
0 commit comments