文档尚不完整,目前我无法在Mac上使用dotnet使用或发布软件包到GPR。任何帮助都会有用
答案 0 :(得分:1)
您可以在此链接上看到to the github community question,GPR目前不支持dotnet nuget,您必须将nuget与Mono一起使用或从Windows发布。
我希望他们会在不久的将来自己修复它,这完全阻止了我利用GPR。
答案 1 :(得分:0)
远非理想,我还没有在Mac上进行过测试,但是它在Linux上可以工作
本地添加源
nuget source Add -Name "GitHub" \
-Source "https://nuget.pkg.github.com/MY_ACCOUNT/index.json"
设置api密钥
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
手动参考:
在nuget.config中添加“新来源”。
<add key="GitHub" value="https://nuget.pkg.github.com/MY_ACCOUNT/index.json" />
nuget配置可以
添加到项目:
dotnet add package my.lib \
-v 1.0.0-alpha \
-n # don't download, it can't handle authentication
或者:
编辑项目包参考
<PackageReference Include="my.lib" Version="1.0.0-alpha" />
最后:
dotnet restore
答案 2 :(得分:0)
您必须自己进行HTTP调用(为简便起见,省略了其他步骤):
jobs:
continuous-integration:
runs-on: ubuntu-latest
steps:
- name: push
run: |
for f in ./packages/*.nupkg
do
curl -vX PUT -u "<YOUR USER NAME>:${{ secrets.GITHUB_TOKEN }}" -F package=@$f https://nuget.pkg.github.com/<YOUR USER NAME>/
done
if: github.event_name == 'push'