This is a nuget package for the Tour of heroes API in other to show how to publish a nuget package to GitHub packages.
GitHub Packages only supports authentication using a personal access token (classic)
- Go to your GitHub settings > tokens and create a new token with the
write:packages
scope.
-
Copy the generated token and save it somewhere safe.
-
Add the token to your nuget.config file
cat <<EOF > nuget.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="github" value="https://nuget.pkg.github.com/returngis/index.json" />
</packageSources>
<packageSourceCredentials>
<github>
<add key="Username" value="0gis0" />
<add key="ClearTextPassword" value="$PAT" />
</github>
</packageSourceCredentials>
</configuration>
EOF