ns-ext/script/build-and-push.ps1
2022-11-28 08:55:14 +08:00

24 lines
634 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 ../build/nupkgs/
dotnet build -c Release ../src/NSExt.sln
$files = Get-ChildItem -Path ../build/nupkgs/ -Filter *.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 ../build/nupkgs/ -Filter *.snupkg
foreach($file in $files)
{
dotnet nuget push $file.fullName --skip-duplicate --api-key $apikey --source https://api.nuget.org/v3/index.json
}