我正在设置dotnet
工具和自定义NuGet
软件包服务器之间的交互,并且需要所有可能的
Makefile
(用于测试)如下:
name:=DemoLib
version:=0.1.0
server:=http://localhost:9902/v3/index.json
key:=F143tEizkkeHQr7/cvwCjQ==
clear-cache:
dotnet nuget locals http-cache --clear
pack:
dotnet pack $(name) --output . --include-symbols --include-source -p:PackageVersion=$(version) -p:SymbolPackageFormat=snupkg
publish: clear-cache
dotnet nuget push $(name)/$(name).$(version).nupkg --source $(server) --api-key $(key)
unpublish: clear-cache
dotnet nuget delete $(name) $(version) --source $(server) --api-key $(key) --non-interactive
install: clear-cache
rm -rf ~/.nuget/packages/demolib*
dotnet restore App --verbosity d
dotnet build App
dotnet run -p App
nuget.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="annium" value="http://localhost:9902/v3/index.json" />
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>
DemoLib.csproj:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<DebugType>Portable</DebugType>
<OutputType>Library</OutputType>
</PropertyGroup>
</Project>
App.csproj:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<DebugType>Portable</DebugType>
<OutputType>Exe</OutputType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DemoLib" Version="0.1.0" />
</ItemGroup>
</Project>
nuget.config
以使NuGet发送X-NuGet-ApiKey
标头来注册,版本和下载的URL?<DebugType>Embedded</DebugType>
。这是正确的方法吗?ClearTextPassword
和nuget setapikey
。但是没有效果。