NuGetPushTool 1.0.2
See the version list below for details.
dotnet tool install --global NuGetPushTool --version 1.0.2
dotnet new tool-manifest # if you are setting up this repo dotnet tool install --local NuGetPushTool --version 1.0.2
#tool dotnet:?package=NuGetPushTool&version=1.0.2
nuke :add-package NuGetPushTool --version 1.0.2
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. I feel like there's too much admin and manual steps in this approach.
I've used CI solutions like AppVeyor successfully, but I find AppVeyor kind of hard to setup. It has a maze settings -- I struggle with it. 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 that, 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 and push your packages and symbols, if present.
Get Started
- Install the tool package globally:
dotnet tool install --global NuGetPushTool --version 1.0.1
If you don't have one, create an API key at NuGet.org. Info about this is here.
Create a json file called
nugetpush.json
in a directory above your .NET projects. For example, if your projects are in directories below%userprofile%\source\repos
, then createnugetpush.json
in that folder. At minimum your file should look like the example below. This file is based on this Options model. Put your API key in theApiKey
property.
<details> <summary>Example</summary>
{
"ApiKey": "<your key>"
}
</details>
You should now be able to push packages from any directory on your machine that has NuGet packages. Navigate to the directory in a terminal window and type nugetpush
.
Code Tour
- Options defines available command line options
- Program.cs shows the high-level flow
- Program_methods.cs has the low-level implementation
Product | Versions 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. |
This package has no dependencies.
Version | Downloads | Last updated |
---|---|---|
1.0.3 | 222 | 12/29/2023 |
1.0.2 | 178 | 12/28/2023 |
1.0.0-alpha | 164 | 12/28/2023 |