github 发布nuget包

阅读量: 鲁文奎 2021-04-22 12:04:41
Categories: Tags:

github 发布nuget包

  1. 将nuget.exe放置在相应的目录下
  2. 关联一个nuget仓库
nuget source Add -Name "MVPControls" -Source "https://nuget.pkg.github.com/MVPFramework/index.json" -UserName SixGodZhang -Password 8666faf70088e213aad8d8d083712c220b0dfe89
  1. 修改AssemblyInfo.cs中的相关信息
  2. 生成spec描述文件
nuget spec
  1. 修改spec 文件
    nuget pack
  2. 打包发布

MVPFramework 和 MVPControls 发布到github暂时不用再设置公钥, 如有必要, 重新在github创建一个新的(因为旧的找不到了!)

nuget 官网公钥: MVPFramework 和 MVPControls 发布 统一使用这哥公钥
oy2oo3h45e3wyeyqg64a5ffnflngffqedf2lrrvdqy7swe

nuget push "MVPControls.2020.10.1.nupkg" -Source "https://nuget.pkg.github.com/MVPFramework/index.json" -ApiKey 8666faf70088e213aad8d8d083712c220b0dfe89

nuget push "MVPFramework.2020.10.1.nupkg" oy2oo3h45e3wyeyqg64a5ffnflngffqedf2lrrvdqy7swe -Source "https://api.nuget.org/v3/index.json"

如果提示Nuget包找不到, Tools ->Optins -> Nuget -> Clear All NuGet Cache(s)

相关资料:
https://docs.microsoft.com/zh-cn/nuget/nuget-org/scoped-api-keys