From 8f81a770b5df5320ce3b347cbcd0c9d3533572a2 Mon Sep 17 00:00:00 2001 From: Amanda Tarafa Mas Date: Wed, 29 Nov 2023 12:55:58 -0800 Subject: [PATCH] chore: Use the new SBOM generator tool. --- .config/dotnet-tools.json | 6 ++++++ .kokoro/release.sh | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 676f073e..15910c39 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -7,6 +7,12 @@ "commands": [ "release-progress-reporter" ] + }, + "Google.Cloud.Tools.SbomGenerator": { + "version": "0.3.0", + "commands": [ + "generate-sbom" + ] } } } \ No newline at end of file diff --git a/.kokoro/release.sh b/.kokoro/release.sh index ac37d1ec..606c999e 100644 --- a/.kokoro/release.sh +++ b/.kokoro/release.sh @@ -7,6 +7,8 @@ SCRIPT_DIR=$(dirname "$SCRIPT") cd $SCRIPT_DIR +# Restore tools, in particular the SBOM generator +dotnet tool restore # Make sure secrets are loaded in a well known location before running releasetool source ./populatesecrets.sh @@ -36,4 +38,8 @@ export NUGET_API_KEY="$(cat "$SECRETS_LOCATION"/google-apis-nuget-api-key)" # Push the changes to nuget. cd ./releasebuild/nuget -for pkg in *.nupkg; do dotnet nuget push -s https://api.nuget.org/v3/index.json -k $NUGET_API_KEY $pkg; done + +for pkg in *.nupkg; do + dotnet generate-sbom $pkg + dotnet nuget push -s https://api.nuget.org/v3/index.json -k $NUGET_API_KEY $pkg; +done