Skip to content

chore: Add workflow to publish to NuGet using trusted publishing - #7

Merged
dsherret merged 2 commits into
mainfrom
trusted-publishing
Oct 15, 2026
Merged

dsherret merged 2 commits into
mainfrom
trusted-publishing

Conversation

@dsherret

@dsherret dsherret commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

Adds .github/workflows/publish.yml, which publishes to nuget.org with trusted publishing when a version tag (ex. 2.0.0) is pushed. No long-lived API key is stored.

Steps:

  1. Fails if the tag doesn't match <Version> in the csproj.
  2. Runs the tests.
  3. Packs.
  4. Exchanges the GitHub OIDC token for a short-lived NuGet API key with NuGet/login@v1, as nuget.org user dsherret.
  5. Pushes the package.

Setup

  • nuget.org: add a trusted publishing policy with owner dsherret, repository CodeBlockWriterSharp, workflow file publish.yml, no environment, and package glob pattern CodeBlockWriterSharp.

@dsherret
dsherret merged commit f4668b3 into main Oct 15, 2026
1 check passed
@dsherret
dsherret deleted the trusted-publishing branch October 15, 2026 00:28
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.

1 participant