NuGetPushTool 1.0.0-alpha

This is a prerelease version of NuGetPushTool.
There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global NuGetPushTool --version 1.0.0-alpha                
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local NuGetPushTool --version 1.0.0-alpha                
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=NuGetPushTool&version=1.0.0-alpha&prerelease                
nuke :add-package NuGetPushTool --version 1.0.0-alpha                

Problem Statement

I've not found a really easy way to push updated packages to NuGet.org. You can of course follow Microsoft's own guidance. This is a bit complicated IMO because you need to have the package filename and your API key handy. You can wrap these in a batch file, but there's too much admin here.

I've used CI solutions like AppVeyor successfully, but I find AppVeyor kind of hard to setup. It has a ton of settings -- and to me therefore a discoverability problem. Although I've gotten it to work for some things, I've also found myself unable to get other projects working, and I couldn't figure out why. I've ended up doing it manually through NuGet.org's manual upload UI. I got tired of doing it manually, so I wanted to take a fresh look automating it in a console app. I'd like to be able to navigate to a package build directory and enter a command like this:

nugetpush

The program should find the packages in the current directory along with your API key, which you've placed in a single, defined location out of source control (much like Sleet does).

Code Tour

Remarks

I had a fair bit of ChatGPT help. See a couple convos I had:

  • this
  • and this This didn't give me fully working solutions, but it did give a lot of useful nudges and ideas.

Also, after some reflection, I'm not sure I want to use the Post Build event to trigger a NuGet push because -- as it is now -- it doesn't run any tests. That's a nice thing about CI tools like AppVeyor -- they run your tests before pushing packages.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
1.0.3 224 12/29/2023
1.0.2 180 12/28/2023
1.0.0-alpha 164 12/28/2023