8000 Address review feedback · python/release-tools@41541f8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 41541f8

Browse files
committed
Address review feedback
1 parent 147ff3d commit 41541f8

File tree

3 files changed

+23
-12
lines changed

3 files changed

+23
-12
lines changed

sbom.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -627,12 +627,16 @@ def create_sbom_for_windows_artifact(exe_path):
627627

628628

629629
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))
636640

637641

638642
if __name__ == "__main__":

windows-release/azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ stages:
224224
- ${{ if eq(parameters.DoMSI, 'true') }}:
225225
- stage: PublishPyDotOrg
226226
displayName: Publish to python.org
227-
dependsOn: ['SBOM', 'Test_MSI', 'Test']
227+
dependsOn: ['Test_MSI', 'Test']
228228
jobs:
229229
- template: stage-publish-pythonorg.yml
230230

windows-release/stage-sbom.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,19 @@ jobs:
3434
- powershell: >
3535
python
3636
"$(Build.SourcesDirectory)\sbom.py"
37-
(gci msi\*\python-*.exe | select -First 1)
37+
(gci msi\*\python-*.exe)
3838
workingDirectory: $(Build.BinariesDirectory)
3939
displayName: 'Create SBOMs for binaries'
4040
41-
- task: PublishPipelineArtifact@0
42-
displayName: 'Publish artifact: sbom'
41+
- task: CopyFiles@2
42+
displayName: 'Layout Artifact: sbom'
4343
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'

0 commit comments

Comments
 (0)
0