If you have made changes to the NuGet package, follow these steps to rebuild and test it locally before publishing.
1. Create the NuGet package
Run this command from the lib folder using the Release configuration:
dotnet pack --configuration Release
2. Test locally using a local NuGet repository
To avoid publishing directly to a public registry, add the package to a local source. You must have nuget.exe installed.
On Linux:
nuget.exe add lib/bin/Release/BlingFireNuget.0.1.5.nupkg -Source /home/sergei/BlingFire2/tmplocalnugetrepo/packages/
On Windows:
C:\src\BlingFire\nuget\lib>c:\Users\sergeio\Downloads\nuget.exe add bin\Release\BlingFireNuget.0.1.7.nupkg -Source C:/Users/sergeio/mytestnugets
Configure NuGet.config:
Ensure your NuGet.config includes your local directory as a feed:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="Test Source" value="/home/sergei/BlingFire2/tmplocalnugetrepo/packages" />
</packageSources>
</configuration>
3. Consume the new version
Update your test project (e.g., BlingUtilsTest.csproj) to use the new version and run it in Debug configuration (required because model file paths are hardcoded to the Debug configuration):
mcedit BlingUtilsTest.csproj
dotnet run --configuration Debug BlingUtilsTest.csproj
4. Publish to GitHub
To publish to GitHub, use the dotnet nuget push command with your API token:
dotnet nuget push "bin/Release/BlingFire.x.y.z.nupkg" --source "github" --api-key a123687fef23b8bfake0234820394802ffebc233
dotnet pack --configuration Release