@@ -183,13 +183,20 @@ jobs:
183183 - uses : actions/cache@v5
184184 with :
185185 path : ~/.nuget/packages
186- key : ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', 'global.json', 'dotnet-tools.json') }}
186+ key : ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', 'global.json', '.config/ dotnet-tools.json') }}
187187 restore-keys : ${{ runner.os }}-nuget-
188188
189189 - name : Install .NET workloads
190190 if : matrix.workloads != ''
191191 run : dotnet workload install ${{ matrix.workloads }}
192192
193+ - name : Check code format
194+ if : matrix.runtime == 'linux-x64'
195+ shell : bash
196+ run : |
197+ chmod +x build.sh
198+ ./build.sh Format
199+
193200 - name : Build and test
194201 if : runner.os != 'Windows'
195202 shell : bash
@@ -293,6 +300,8 @@ jobs:
293300 environment : release
294301 permissions :
295302 contents : write
303+ attestations : write
304+ id-token : write
296305 concurrency :
297306 group : release-tag-${{ needs.resolve-version.outputs.tag }}
298307 cancel-in-progress : false
@@ -392,6 +401,20 @@ jobs:
392401 shell : bash
393402 run : echo "::warning::NUGET_API_KEY not configured. Skipping NuGet push."
394403
404+ - name : Generate SBOM
405+ uses : anchore/sbom-action@v0
406+ with :
407+ artifact-name : sbom-spdx.json
408+ output-file : sbom-spdx.json
409+ format : spdx-json
410+
411+ - name : Attest build provenance
412+ uses : actions/attest-build-provenance@v2
413+ with :
414+ subject-path : |
415+ packages/*.nupkg
416+ installers/*.zip
417+
395418 - name : Create and push tag
396419 shell : bash
397420 run : |
@@ -432,7 +455,12 @@ jobs:
432455 exit 1
433456 fi
434457
435- gh release create "$TAG" "${RELEASE_FILES[@]}" \
458+ SBOM_FILE=""
459+ if [ -f "sbom-spdx.json" ]; then
460+ SBOM_FILE="sbom-spdx.json"
461+ fi
462+
463+ gh release create "$TAG" "${RELEASE_FILES[@]}" $SBOM_FILE \
436464 --title "$RELEASE_NAME" \
437465 --generate-notes
438466 echo "Created release $TAG with ${#RELEASE_FILES[@]} assets"
0 commit comments