From 1c6c9bdc9e5e2bede2d0bc3c83ce550848567628 Mon Sep 17 00:00:00 2001 From: Mark Heath Date: Sat, 9 Jan 2021 10:54:42 +0000 Subject: [PATCH] automate pushing the NuGet packages --- publish.ps1 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 publish.ps1 diff --git a/publish.ps1 b/publish.ps1 new file mode 100644 index 00000000..d7134f02 --- /dev/null +++ b/publish.ps1 @@ -0,0 +1,15 @@ +# publishes to NuGet +# $apiKey needs to be already set up with NuGet publishing key +$packages = "NAudio.Core", "NAudio.Asio", "NAudio.WinForms", "NAudio.Midi", + "NAudio.WinMM", "NAudio.Wasapi", "NAudio.Uap", + "NAudio", "NAudio.Extras" + +foreach ($package in $packages) +{ + # publish the most recently created .nupkg file + $folder = "$package\bin\Release" + $recent = gci "$folder\*.nupkg" | sort LastWriteTime | select -last 1 + $pkg = $recent.Name + # note that this will fail with 409 error if you try to push package that already exists + dotnet nuget push "$folder\$pkg" --api-key $apiKey --source https://api.nuget.org/v3/index.json +} \ No newline at end of file