Ocelot/nuget/build-and-push.ps1
nsnail c2eb375f91 * 当body 为 FileBufferingReadStream,可能会出现request.Body.Length=0的情况
* 修改package id 避免下载到原版
* 发布到nuget.org
2022-11-30 15:54:47 +08:00

24 lines
666 B
PowerShell
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ¶¨Òå²ÎÊý
Param(
# Nuget APIKey
[string] $apikey
)
if ($apikey -eq $null -or $apikey -eq "")
{
Write-Error "±ØÐëÖ¸¶¨apiKey";
return;
}
rm -r ../src/Ocelot/bin/Release
dotnet build -c Release ../Ocelot.sln
$files = Get-ChildItem -Path ../src/Ocelot/bin/Release -Filter *-ns*.nupkg
foreach($file in $files)
{
dotnet nuget push $file.fullName --skip-duplicate --api-key $apikey --source https://api.nuget.org/v3/index.json
}
$files = Get-ChildItem -Path ../src/Ocelot/bin/Release -Filter *-ns*.snupkg
foreach($file in $files)
{
dotnet nuget push $file.fullName --skip-duplicate --api-key $apikey --source https://api.nuget.org/v3/index.json
}