Skip to content
This repository has been archived by the owner on Jul 14, 2023. It is now read-only.

NuGet Packaging and Publishing

jpo424 edited this page Sep 29, 2017 · 6 revisions

Installing and Configuring NuGet(Windows)

  1. Download the latest stable version from https://www.nuget.org/downloads
  2. Place the exe in a safe/permanent place somewhere in your /Users directory; give it it's own folder
  3. Add the above created folder to your PATH Windows environment variable.
  4. Open up console, confirm nuget command does something
  5. To configure: nuget setApiKey <key>

Packaging

NOTE: In our repo now is an already generated .nuspec file. This file is THE prerequisite for packaging and publishing to NuGet. To generate this file, I navigated to the repo folder with YChartsApi.sln file and ran nuget spec. When that file is generated in this manner, variables are tokenized(like string templating) to pull assembly/package meta data directly from AssemblyInfo.cs. Every time we want to change our deployed NuGet package, like changing version numbers, we edit that file.

  1. After code is committed and AssemblyInfo.cs is updated, run nuget pack YChartsApi.csproj -Prop Configuration=Release. That will create a file of type .nupkg in the current directory. This is the file we push to NuGet

Publishing

  1. nuget push YChartsAp<assembly file version>.nupkg -Source https://www.nuget.org

NOTE: After a package is push to NuGet, it typically takes about 10 minutes for it be indexed and available for download/install.

Clone this wiki locally