Skip to content

Attach NuGet packages and SBOM to GitHub Release - #1169

Merged
jbogard merged 1 commit into
mainfrom
ci/attach-release-assets
May 16, 2026
Merged

Attach NuGet packages and SBOM to GitHub Release#1169
jbogard merged 1 commit into
mainfrom
ci/attach-release-assets

Conversation

@jbogard

@jbogard jbogard commented May 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Grants contents: write to the Release workflow so it can attach assets to the release the maintainer creates in the UI.
  • Adds an "Attach assets to GitHub Release" step in the build job that uses the preinstalled gh CLI 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 --clobber so 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 like 99.0.0-test1 would publish a real package to NuGet.org (which only allows unlisting, not deletion within 72 hours).

Verification happens on the next real release:

  • After the next release, confirm the "Attach assets to GitHub Release" step succeeds.
  • Confirm four assets land on the release page: MediatR.<ver>.nupkg, MediatR.<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 run gh release upload <tag> <files> --clobber locally as a fallback.

🤖 Generated with Claude Code

Grants contents: write to the Release workflow and adds a step that uses
the preinstalled gh CLI to upload signed *.nupkg, *.snupkg, and SBOM
(manifest.spdx.json + .sha256) to the release for the pushed tag. Uses
--clobber so re-runs refresh assets instead of failing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the release workflow so that, on tagged releases, it can upload build artifacts (NuGet packages and SBOM files) as assets on the corresponding GitHub Release.

Changes:

  • Grants the workflow contents: write permission to allow uploading release assets.
  • Adds a post-publish step that uses the gh CLI to upload *.nupkg, *.snupkg, and SBOM files to the GitHub Release for the tag (with --clobber for idempotent reruns).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml
@jbogard
jbogard merged commit c3e2419 into main May 16, 2026
10 checks passed
@jbogard
jbogard deleted the ci/attach-release-assets branch May 16, 2026 14:47
This was referenced Jul 2, 2026
This was referenced Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants