Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,41 @@ jobs:
}
}

- name: Generate SBOM (CycloneDX)
if: steps.check-packages.outputs.has-packages == 'true'
shell: pwsh
run: |
dotnet tool install --global CycloneDX

$sbomDir = Join-Path $PWD 'nuget-packages'
$srcProjects = Get-ChildItem -Path 'src' -Filter '*.csproj' -Recurse -ErrorAction SilentlyContinue

if ($srcProjects.Count -eq 0) {
Write-Warning "No projects found in src/ - skipping SBOM generation"
return
}

foreach ($proj in $srcProjects) {
$sbomName = "$($proj.BaseName).bom.json"
$sbomPath = Join-Path $sbomDir $sbomName

Write-Host "📋 Generating SBOM for $($proj.Name)" -ForegroundColor Cyan
dotnet CycloneDX $proj.FullName --output $sbomDir --filename $sbomName --json

if ($LASTEXITCODE -ne 0) {
Write-Warning "⚠️ SBOM generation failed for $($proj.Name) - continuing"
} else {
Write-Host "✅ SBOM generated: $sbomName" -ForegroundColor Green
}
}


- name: Upload NuGet packages as artifacts
uses: actions/upload-artifact@v4
with:
name: nuget-packages
path: ./nuget-packages/*.nupkg
./nuget-packages/*.bom.json
retention-days: 30

- name: Publish NuGet Package
Expand All @@ -106,6 +136,7 @@ jobs:
run: |
$packagesPath = Join-Path $PWD 'nuget-packages'
Get-ChildItem -Path $packagesPath -Filter '*.nupkg' | ForEach-Object {
./nuget-packages/*.bom.json
Write-Host "Publishing $($_.FullName)"
dotnet nuget push $_.FullName --api-key $env:NUGET_API_KEY --source https://api.nuget.org/v3/index.json --skip-duplicate
if ($LASTEXITCODE -ne 0) {
Expand Down