Blog Entry
发布NuGet包
发布NuGet包
- Created
- 2023/08/25
- Updated
- 2023/08/25
环境
❯ dotnet --version8.0.100-preview.7.23376.3账户
- 登录NuGet Gallery | Home
- 生成一个
Api Key
打包
- 填一些项目的
Package配置:
- 打包
dotnet pack -c Release ./src/Kx.Toolx.Clicky发布
手动apikey
- 取得前面在
nuget.org生成的Api Key - 发布:
❯ dotnet nuget push .\Kx.Toolx.Clicky.0.1.4.nupkg --api-key $ApiKey --source https://api.nuget.org/v3/index.json正在将 Kx.Toolx.Clicky.0.1.4.nupkg 推送到 'https://www.nuget.org/api/v2/package'... PUT https://www.nuget.org/api/v2/package/warn : License missing. See how to include a license within the package: https://aka.ms/nuget/authoring-best-practices#licensing.,Readme missing. Go to https://aka.ms/nuget-include-readme learn How to include a readme file within the package. Created https://www.nuget.org/api/v2/package/ 29282 毫秒已推送包。自动apikey
- 给指定服务器保存
ApiKey
nuget setapikey $ApiKey -source https://api.nuget.org/v3/index.json- 然后发布的时候可以省略
ApiKey
nuget push .\Kx.Toolx.Clicky.0.1.4.nupkg -source https://api.nuget.org/v3/index.json