You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Furion/nuget-push.ps1

33 lines
867 B
C#

#
Param(
# NuGet APIKey
[string] $apikey
)
Write-Warning "正在发布 framework 目录 NuGet 包......";
# .\framework\nupkgs
cd .\framework\nupkgs;
$framework_nupkgs = Get-ChildItem -Filter *.nupkg;
# *.nupkg
for ($i = 0; $i -le $framework_nupkgs.Length - 1; $i++){
$item = $framework_nupkgs[$i];
$nupkg = $item.FullName;
$snupkg = $nupkg.Replace(".nupkg", ".snupkg");
Write-Output "-----------------";
$nupkg;
# nuget.org
dotnet nuget push $nupkg --skip-duplicate --api-key $apikey --source https://api.nuget.org/v3/index.json;
dotnet nuget push $snupkg --skip-duplicate --api-key $apikey --source https://api.nuget.org/v3/index.json;
Write-Output "-----------------";
}
#
cd ../../;
Write-Warning "发布成功";