Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nuget publish automation #247

Merged
merged 1 commit into from
Mar 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Nuget publish automanition
  • Loading branch information
Ruslan Balanukhin committed Mar 15, 2023
commit a8ea705378e7dcd888c8616ee48b1f4a133f6e8c
17 changes: 17 additions & 0 deletions publish.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
$version = (Select-Xml -Path Directory.Build.props -XPath '/Project/PropertyGroup/Version').Node.'#text'
$version
dotnet build --configuration Release
dotnet test --configuration Release
dotnet pack --configuration Release
$confirmation = Read-Host "Are you sure you want to push nuget packages (y - yes, n - no):"
if ($confirmation -eq 'y') {
$source = https://api.nuget.org/v3/index.json
$apiKey = $Env:NUGET_API_KEY
dotnet nuget push ".\FFmpeg.AutoGen\bin\Release\FFmpeg.AutoGen.$version.nupkg" --source $source --api-key $apiKey
dotnet nuget push .\FFmpeg.AutoGen.Abstractions\bin\Release\FFmpeg.AutoGen.Abstractions.$version.nupkg --source $source --api-key $apiKey
dotnet nuget push .\FFmpeg.AutoGen.Bindings.DynamicallyLinked\bin\Release\FFmpeg.AutoGen.Bindings.DynamicallyLinked.$version.nupkg --source $source --api-key $apiKey
dotnet nuget push .\FFmpeg.AutoGen.Bindings.DynamicallyLoaded\bin\Release\FFmpeg.AutoGen.Bindings.DynamicallyLoaded.$version.nupkg --source $source --api-key $apiKey
dotnet nuget push .\FFmpeg.AutoGen.Bindings.StaticallyLinked\bin\Release\FFmpeg.AutoGen.Bindings.StaticallyLinked.$version.nupkg --source $source --api-key $apiKey
git tag v$version
git push origin v$version
}