Skip to content

Add automated NuGet publishing workflow#592

Merged
RevenantX merged 2 commits intoRevenantX:masterfrom
roku674:master
Mar 22, 2026
Merged

Add automated NuGet publishing workflow#592
RevenantX merged 2 commits intoRevenantX:masterfrom
roku674:master

Conversation

@roku674
Copy link
Copy Markdown
Contributor

@roku674 roku674 commented Mar 19, 2026

[Copy Paste figured you'd want it here too] This PR adds a GitHub Actions workflow to automate NuGet package publishing.

What it does

  • Triggers on push to master branch (or manual workflow dispatch)
  • Compares the version in LiteNetLib/LiteNetLib.csproj against the latest version on NuGet.org
  • If the version has changed, it builds, packs, and publishes to NuGet.org
  • Skips publishing if version is unchanged (avoids "package already exists" errors)

Setup required

You'll need to add a NUGET_API_KEY secret to your repository settings:

  1. Go to Repository Settings → Secrets and variables → Actions
  2. Add a new secret named NUGET_API_KEY with your NuGet.org API key

How to publish a new version

  1. Update the <Version> tag in LiteNetLib/LiteNetLib.csproj
  2. Commit and push to master
  3. The workflow will automatically detect the version change and publish

This workflow pattern is adapted from an open-source C# project that uses the same approach for automated NuGet publishing.

@roku674
Copy link
Copy Markdown
Contributor Author

roku674 commented Mar 19, 2026

@RevenantX

@RevenantX
Copy link
Copy Markdown
Owner

It should not be automatic. As manual action i will include this

Removed automatic push trigger for master branch.
@RevenantX RevenantX merged commit 8e1eebe into RevenantX:master Mar 22, 2026
1 check was pending
@RevenantX
Copy link
Copy Markdown
Owner

Also seems it need to use instead of

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