Skip to content

Commit 1c6c9bd

Browse files
committed
automate pushing the NuGet packages
1 parent c0cf8ce commit 1c6c9bd

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

publish.ps1

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# publishes to NuGet
2+
# $apiKey needs to be already set up with NuGet publishing key
3+
$packages = "NAudio.Core", "NAudio.Asio", "NAudio.WinForms", "NAudio.Midi",
4+
"NAudio.WinMM", "NAudio.Wasapi", "NAudio.Uap",
5+
"NAudio", "NAudio.Extras"
6+
7+
foreach ($package in $packages)
8+
{
9+
# publish the most recently created .nupkg file
10+
$folder = "$package\bin\Release"
11+
$recent = gci "$folder\*.nupkg" | sort LastWriteTime | select -last 1
12+
$pkg = $recent.Name
13+
# note that this will fail with 409 error if you try to push package that already exists
14+
dotnet nuget push "$folder\$pkg" --api-key $apiKey --source https://api.nuget.org/v3/index.json
15+
}

0 commit comments

Comments
 (0)