After a lot of trial and error I eventually got my NuGet package on the Github package registry with the following actions/commands:
write:packages
, read:packages
, delete:packages
repo
scope for your OAuth tokendotnet nuget add source --username [GithubUserName] --password [YourApiKey] --name github https://nuget.pkg.github.com/[UsernameOrOrganizationName]/index.json
github
source
dotnet nuget push --source github bin\Release\MyAwesomePackage.1.0.0.nupkg
I can see my NuGet package on GitHub, so now I want to install it.
Now I should be able to install my package. But when I select my source and browse for packages, a GitHub login window pops up. And even when I login with my user account credentials, I still can't access my packages (pushed to an organization Github). Now when I use the NuGet package manager for my custom package source I always get the following error in the Output Window
:
[source-name] Failed to retrieve metadata from source 'https://nuget.pkg.github.com/[UsernameOrOrganizationname]/query?q=&skip=0&take=26&prerelease=true&semVerLevel=2.0.0'.
Response status code does not indicate success: 401 (Unauthorized).
The packages pushed to the GitHub registry should be public, and even with my user account I can't access them for installation. However they appear on my organization's GitHub page. Also the other users shouldn't have to add my personal GitHub package source, but rather the package should appear in some global GitHub feed inside the package manager, not?
What am I doing wrong?
It appears that righg now it's not yet possible: https://github.community/t/download-from-github-package-registry-without-authentication/14407/39