Skip to content

Commit

Permalink
automate pushing the NuGet packages
Browse files Browse the repository at this point in the history
  • Loading branch information
markheath committed Jan 9, 2021
1 parent c0cf8ce commit 1c6c9bd
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions publish.ps1
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit 1c6c9bd

Please sign in to comment.