Attach NuGet packages and SBOM to GitHub Release#4637
Merged
Conversation
Grant contents: write so the Release workflow can attach assets to the release the maintainer creates in the UI. Add a step that uses the preinstalled gh CLI to upload the signed *.nupkg, *.snupkg, and the SBOM (manifest.spdx.json + .sha256) to the release for the pushed tag, with --clobber so re-runs of the same tag refresh assets instead of failing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Extends the Release workflow so that, after publishing to NuGet, the signed packages and the generated SBOM are uploaded as assets to the GitHub Release that the maintainer created for the pushed tag.
Changes:
- Elevates the workflow's
contentspermission fromreadtowriteso the workflow can attach release assets. - Adds a new "Attach assets to GitHub Release" step in
build-windowsthat usesgh release uploadwith--clobberto push*.nupkg,*.snupkg, and the SPDX SBOM (manifest.spdx.jsonand its.sha256) to the release for the current tag.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
contents: writeto the Release workflow so it can attach assets to the release the maintainer creates in the UI.build-windowsjob that uses the preinstalledghCLI to upload the signed*.nupkg,*.snupkg, and SBOM (manifest.spdx.json+.sha256) to the release for the pushed tag. Runs after Push to NuGet, uses--clobberso re-runs of the same tag refresh assets instead of failing.Test plan
No safe pre-merge rehearsal: the workflow triggers on any
*.*.*tag and the new step runs after Push to MyGet/NuGet, so a throwaway tag like99.0.0-test1would publish a real package to NuGet.org (which only allows unlisting, not deletion within 72 hours).Verification happens on the next real release:
AutoMapper.<ver>.nupkg,AutoMapper.<ver>.snupkg,manifest.spdx.json,manifest.spdx.json.sha256.If the new step fails, the packages are already on the public feeds; re-run the job (idempotent via
--clobber) or rungh release upload <tag> <files> --clobberlocally as a fallback.🤖 Generated with Claude Code