The documentation is not complete and currently I cannot consume or publish package to GPR using dotnet on Mac. Any help would be useful
Far from ideal, and I haven't tested on Mac yet, but it worked on Linux
Add source locally
nuget source Add -Name "GitHub" \
-Source "https://nuget.pkg.github.com/MY_ACCOUNT/index.json"
Set api key
nuget setApiKey $TOKEN \
-Source "https://nuget.pkg.github.com/MY_ACCOUNT/index.json"
nuget push "my.lib.nupkg" -Source "GitHub"
nuget install my.lib -pre # '-pre' because of alpha, if alpha
Note: 'nuget install' downloads the nuget package It doesn't add it to the project. 'dotnet' can't find it Do it anyway so it gets cached in `~/.nuget/packages` The `./project` relative downloaded package can be deleted
Reference manually:
Add 'new Source' to nuget.config.
<add key="GitHub" value="https://nuget.pkg.github.com/MY_ACCOUNT/index.json" />
nuget config can be
Add to project:
dotnet add package my.lib \
-v 1.0.0-alpha \
-n # don't download, it can't handle authentication
Alternatively:
Edit project package reference
<PackageReference Include="my.lib" Version="1.0.0-alpha" />
Finally:
dotnet restore
As you can see at this link to the github community question dotnet nuget is currently not supported by the GPR and you rather have to use nuget with Mono or publish from Windows.
I hope they'll fix it in the near future myself, it's completely stopping me from taking advantage of the GPR.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With