Skip to content

Commit ef1f9b9

Browse files
Further refactoring and simplification
1 parent 40bfdfa commit ef1f9b9

2 files changed

Lines changed: 34 additions & 172 deletions

File tree

.github/scripts/artifact-checksums.ps1

Lines changed: 0 additions & 90 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 34 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ env:
1515
VERSION: ${{ github.ref_name }}
1616
# Public, deliberately pinned identity. The strong-name counterpart lives in eng/IG.publickey.hex.
1717
EXPECTED_CERT_SUBJECT_CN: 'Infragistics, Inc.'
18+
# Bound sbom-tool's external license lookup.
19+
SBOM_LICENSE_TIMEOUT_SECONDS: '180'
1820

1921
jobs:
2022
# Holds the strong-name key, but no OIDC token, no Key Vault access and no publishing rights.
@@ -24,8 +26,6 @@ jobs:
2426
timeout-minutes: 20
2527
permissions:
2628
contents: read
27-
outputs:
28-
manifest-sha256: ${{ steps.checksums.outputs.manifest-sha256 }}
2929

3030
steps:
3131
- name: Checkout
@@ -83,14 +83,6 @@ jobs:
8383
shell: pwsh
8484
run: Remove-Item "${{ runner.temp }}\IG.StrongName.snk" -Force -ErrorAction SilentlyContinue
8585

86-
- name: Record build output checksums
87-
id: checksums
88-
shell: pwsh
89-
run: >
90-
.github/scripts/artifact-checksums.ps1 -Mode Write -ManifestPath build-output.sha256
91-
-Path src/IgniteUI.Blazor.GridLite/bin, src/IgniteUI.Blazor.GridLite/obj,
92-
src/IgniteUI.Blazor.GridLite/wwwroot/js, src/IgniteUI.Blazor.GridLite/wwwroot/css/themes
93-
9486
- name: Upload build output
9587
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
9688
with:
@@ -100,7 +92,6 @@ jobs:
10092
src/IgniteUI.Blazor.GridLite/obj/**
10193
src/IgniteUI.Blazor.GridLite/wwwroot/js/**
10294
src/IgniteUI.Blazor.GridLite/wwwroot/css/themes/**
103-
build-output.sha256
10495
include-hidden-files: true
10596
retention-days: 1
10697
if-no-files-found: error
@@ -114,8 +105,6 @@ jobs:
114105
permissions:
115106
contents: read
116107
id-token: write
117-
outputs:
118-
manifest-sha256: ${{ steps.checksums.outputs.manifest-sha256 }}
119108

120109
steps:
121110
- name: Checkout
@@ -133,16 +122,7 @@ jobs:
133122
with:
134123
name: build-output
135124
path: .
136-
137-
- name: Verify build output
138-
shell: pwsh
139-
env:
140-
EXPECTED_MANIFEST_HASH: ${{ needs.build.outputs.manifest-sha256 }}
141-
run: >
142-
.github/scripts/artifact-checksums.ps1 -Mode Verify -ManifestPath build-output.sha256
143-
-Path src/IgniteUI.Blazor.GridLite/bin, src/IgniteUI.Blazor.GridLite/obj,
144-
src/IgniteUI.Blazor.GridLite/wwwroot/js, src/IgniteUI.Blazor.GridLite/wwwroot/css/themes
145-
-ExpectedManifestHash $env:EXPECTED_MANIFEST_HASH
125+
digest-mismatch: error
146126

147127
- name: Restore .NET local tools
148128
run: dotnet tool restore
@@ -200,14 +180,6 @@ jobs:
200180
"- Thumbprint: $($thumbprints.Keys -join ', ')"
201181
) | Add-Content -LiteralPath $env:GITHUB_STEP_SUMMARY
202182
203-
- name: Record signed assembly checksums
204-
id: checksums
205-
shell: pwsh
206-
run: >
207-
.github/scripts/artifact-checksums.ps1 -Mode Write -ManifestPath signed-assemblies.sha256
208-
-Path src/IgniteUI.Blazor.GridLite/bin, src/IgniteUI.Blazor.GridLite/obj,
209-
src/IgniteUI.Blazor.GridLite/wwwroot/js, src/IgniteUI.Blazor.GridLite/wwwroot/css/themes
210-
211183
- name: Upload signed assemblies
212184
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
213185
with:
@@ -217,7 +189,6 @@ jobs:
217189
src/IgniteUI.Blazor.GridLite/obj/**
218190
src/IgniteUI.Blazor.GridLite/wwwroot/js/**
219191
src/IgniteUI.Blazor.GridLite/wwwroot/css/themes/**
220-
signed-assemblies.sha256
221192
include-hidden-files: true
222193
retention-days: 1
223194
if-no-files-found: error
@@ -250,16 +221,7 @@ jobs:
250221
with:
251222
name: signed-assemblies
252223
path: .
253-
254-
- name: Verify signed assemblies
255-
shell: pwsh
256-
env:
257-
EXPECTED_MANIFEST_HASH: ${{ needs.sign-assemblies.outputs.manifest-sha256 }}
258-
run: >
259-
.github/scripts/artifact-checksums.ps1 -Mode Verify -ManifestPath signed-assemblies.sha256
260-
-Path src/IgniteUI.Blazor.GridLite/bin, src/IgniteUI.Blazor.GridLite/obj,
261-
src/IgniteUI.Blazor.GridLite/wwwroot/js, src/IgniteUI.Blazor.GridLite/wwwroot/css/themes
262-
-ExpectedManifestHash $env:EXPECTED_MANIFEST_HASH
224+
digest-mismatch: error
263225

264226
- name: Pack NuGet package
265227
run: >
@@ -400,46 +362,36 @@ jobs:
400362
- name: Restore sbom-tool (pinned)
401363
run: dotnet tool restore --tool-manifest .config/sbom-tool/dotnet-tools.json
402364

403-
# sbom-tool fails unless the -m directory already exists.
404-
- name: Create SBOM output directories
405-
shell: pwsh
406-
run: New-Item -ItemType Directory -Force -Path "${{ github.workspace }}\sbom\spdx-2.2", "${{ github.workspace }}\sbom\spdx-3.0" | Out-Null
407-
408365
# -b is the signed package folder, so the shipped nupkg and its hash land in the SBOM's files section.
409366
# -bc scans the library project (NuGet + npm) for the dependency graph; -li/-pm resolve license and supplier metadata.
410-
- name: Generate SBOM (SPDX 2.2)
367+
- name: Generate SBOMs
411368
working-directory: .config/sbom-tool
412-
run: >
413-
dotnet tool run sbom-tool -- generate
414-
-b ${{ github.workspace }}/artifacts
415-
-bc ${{ github.workspace }}/src/IgniteUI.Blazor.GridLite
416-
-m ${{ github.workspace }}/sbom/spdx-2.2
417-
-pn IgniteUI.Blazor.GridLite
418-
-pv $env:VERSION
419-
-ps Infragistics
420-
-nsb http://spdx.org/spdxdocs/IgniteUI.Blazor.GridLite
421-
-mi SPDX:2.2
422-
-li true
423-
-lto 60
424-
-pm true
425-
-V Information
426-
427-
- name: Generate SBOM (SPDX 3.0)
428-
working-directory: .config/sbom-tool
429-
run: >
430-
dotnet tool run sbom-tool -- generate
431-
-b ${{ github.workspace }}/artifacts
432-
-bc ${{ github.workspace }}/src/IgniteUI.Blazor.GridLite
433-
-m ${{ github.workspace }}/sbom/spdx-3.0
434-
-pn IgniteUI.Blazor.GridLite
435-
-pv $env:VERSION
436-
-ps Infragistics
437-
-nsb http://spdx.org/spdxdocs/IgniteUI.Blazor.GridLite
438-
-mi SPDX:3.0
439-
-li true
440-
-lto 60
441-
-pm true
442-
-V Information
369+
shell: pwsh
370+
run: |
371+
$ErrorActionPreference = 'Stop'
372+
$PSNativeCommandUseErrorActionPreference = $true
373+
374+
$formats = @(
375+
@{ Version = 'SPDX:2.2'; Output = 'spdx-2.2' },
376+
@{ Version = 'SPDX:3.0'; Output = 'spdx-3.0' }
377+
)
378+
379+
foreach ($format in $formats) {
380+
Write-Host "Generating $($format.Version) SBOM..."
381+
dotnet tool run sbom-tool -- generate `
382+
-b "$env:GITHUB_WORKSPACE\artifacts" `
383+
-bc "$env:GITHUB_WORKSPACE\src\IgniteUI.Blazor.GridLite" `
384+
-m "$env:GITHUB_WORKSPACE\sbom\$($format.Output)" `
385+
-pn IgniteUI.Blazor.GridLite `
386+
-pv $env:VERSION `
387+
-ps Infragistics `
388+
-nsb http://spdx.org/spdxdocs/IgniteUI.Blazor.GridLite `
389+
-mi $format.Version `
390+
-li true `
391+
-lto $env:SBOM_LICENSE_TIMEOUT_SECONDS `
392+
-pm true `
393+
-V Information
394+
}
443395
444396
- name: Verify SBOM output
445397
shell: pwsh
@@ -448,9 +400,9 @@ jobs:
448400
$spdx22 = "${{ github.workspace }}\sbom\spdx-2.2\_manifest\spdx_2.2\manifest.spdx.json"
449401
$spdx30 = "${{ github.workspace }}\sbom\spdx-3.0\_manifest\spdx_3.0\manifest.spdx.json"
450402
451-
foreach ($document in @($spdx22, $spdx30)) {
452-
if (-not (Test-Path -LiteralPath $document) -or (Get-Item -LiteralPath $document).Length -eq 0) {
453-
throw "SBOM document missing or empty: $document"
403+
foreach ($manifestPath in @($spdx22, $spdx30)) {
404+
if (-not (Test-Path -LiteralPath $manifestPath) -or (Get-Item -LiteralPath $manifestPath).Length -eq 0) {
405+
throw "SBOM manifest missing or empty: $manifestPath"
454406
}
455407
}
456408

0 commit comments

Comments
 (0)