Install reportgenerator once if not already installed:
dotnet tool install -g dotnet-reportgenerator-globaltoolEnsure ~/.dotnet/tools is in your PATH (add to ~/.zshrc if missing):
export PATH="$HOME/.dotnet/tools:$PATH"dotnet test JsonFlatFileDataStore.Test/JsonFlatFileDataStore.Test.csproj --collect:"XPlat Code Coverage"
reportgenerator \
-reports:"JsonFlatFileDataStore.Test/TestResults/**/coverage.cobertura.xml" \
-targetdir:"coverage-report" \
-reporttypes:Html
open coverage-report/index.html # macOS (Linux: xdg-open, Windows: start)- Update the version (example). Edit
Version,PackageVersion,AssemblyVersionandFileVersionin the csproj with an editor. Also add the version toCHANGELOG.mdand to the version selector indocs/index.html. Don't push yet, smoke test first, so a packaging problem is fixed in the same commit instead of needing a follow-up one. - Smoke test the package. A push to nuget.org can't be undone, a version number can be unlisted but never reused.
dotnet testuses project references, so it passes even when the package itself is broken.
$ ./scripts/smoke-test-package.shPacks the library from the current source, checks the .nupkg contents, then runs a throwaway console app against it. No prior dotnet build needed; the script's header comment explains the details.
- Commit the version changes and push to master.
- Update Tags
$ git tag x.x.x
$ git push origin --tags- Build new release. Check API key from Nuget
$ dotnet build --configuration Release
$ dotnet nuget push .\JsonFlatFileDataStore\bin\Release\JsonFlatFileDataStore.x.x.x.nupkg --source https://api.nuget.org/v3/index.json --api-key xxxxx- Smoke test the published package. Same checks as step 2, but against the artifact users will actually restore — this catches a bad upload or a package that behaves differently once it comes from the live feed.
$ ./scripts/smoke-test-package.sh --from-nuget x.x.xnuget.org indexing lags a minute or two behind the push, so a restore failure right afterwards usually just means "not indexed yet" — wait and rerun.