From 7eb7e58b15600188cb366f0ecf28d490c6ab0328 Mon Sep 17 00:00:00 2001 From: Danijel Peric Date: Sun, 26 Mar 2023 12:42:30 +0200 Subject: [PATCH] added build, publish and nuget --- Build.ps1 | 36 ++++++++++++++++++ NuGet.Config | 6 +++ Push.ps1 | 18 +++++++++ README.md | 2 +- icon.jpg | Bin 0 -> 5269 bytes .../MediatR.ParallelPublisher.csproj | 16 ++++++++ 6 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 Build.ps1 create mode 100644 NuGet.Config create mode 100644 Push.ps1 create mode 100644 icon.jpg diff --git a/Build.ps1 b/Build.ps1 new file mode 100644 index 0000000..2a4de2d --- /dev/null +++ b/Build.ps1 @@ -0,0 +1,36 @@ +# Taken from psake https://github.com/psake/psake + +<# +.SYNOPSIS + This is a helper function that runs a scriptblock and checks the PS variable $lastexitcode + to see if an error occcured. If an error is detected then an exception is thrown. + This function allows you to run command-line programs without having to + explicitly check the $lastexitcode variable. +.EXAMPLE + exec { svn info $repository_trunk } "Error executing SVN. Please verify SVN command-line client is installed" +#> +function Exec +{ + [CmdletBinding()] + param( + [Parameter(Position=0,Mandatory=1)][scriptblock]$cmd, + [Parameter(Position=1,Mandatory=0)][string]$errorMessage = ($msgs.error_bad_command -f $cmd) + ) + & $cmd + if ($lastexitcode -ne 0) { + throw ("Exec: " + $errorMessage) + } +} + +$artifacts = ".\artifacts" + +if(Test-Path $artifacts) { Remove-Item $artifacts -Force -Recurse } + +exec { & dotnet clean -c Release } + +exec { & dotnet build -c Release } + +exec { & dotnet test -c Release --no-build -l trx --verbosity=normal } + +exec { & dotnet pack .\src\MediatR.ParallelPublisher\MediatR.ParallelPublisher.csproj -c Release -o $artifacts --no-build } + diff --git a/NuGet.Config b/NuGet.Config new file mode 100644 index 0000000..3f0e003 --- /dev/null +++ b/NuGet.Config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Push.ps1 b/Push.ps1 new file mode 100644 index 0000000..b9a03e0 --- /dev/null +++ b/Push.ps1 @@ -0,0 +1,18 @@ +$scriptName = $MyInvocation.MyCommand.Name +$artifacts = "./artifacts" + +if ([string]::IsNullOrEmpty($Env:NUGET_API_KEY)) { + Write-Host "${scriptName}: NUGET_API_KEY is empty or not set. Skipped pushing package(s)." +} else { + Get-ChildItem $artifacts -Filter "*.nupkg" | ForEach-Object { + Write-Host "$($scriptName): Pushing $($_.Name)" + Write-Host "NUGET_URL: $Env:NUGET_URL" + Write-Host "NUGET_API_KEY: $Env:NUGET_API_KEY" + Write-Host "PACKAGE: $_.FullName" + + dotnet nuget push $_.FullName --source $Env:NUGET_URL --api-key $Env:NUGET_API_KEY + if ($lastexitcode -ne 0) { + throw ("Exec: " + $errorMessage) + } + } +} diff --git a/README.md b/README.md index c89521c..ae5072c 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ public class MyCustomExceptionHandler : INotificationExceptionHandler ## License -MediatR.ParallelPublisher is released under the Apache License. See the LICENSE file for details. +MediatR.ParallelPublisher is released under the Apache License. See the [LICENSE](https://github.com/koderi-dp/MediatR.ParallelPublisher/blob/main/LICENSE) file for details. ## Contributing Contributions are welcome! Feel free to submit issues, feature requests, or pull requests. \ No newline at end of file diff --git a/icon.jpg b/icon.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2d32eda16c3954b73ec5b48e73e19152f400773b GIT binary patch literal 5269 zcmb7oWmFVi^z95o4>3b`&A>=XJ9LlC&@Eje9YceNAdN6|NjF0&NDNq%q=Ga8A}OJi zASft2e($aI*8l5&-}C97v-jEe!&!ITd%bYI3V>ixXcPbl1Ogmx7T|gbpaB385&ai8 zAifC_auO0^ViHO+GE#CXN-8QaB^XRiLkFRzfzp7%5GDweo`I2(k&2d?g^7WMj)9Tk zKM^44hC@t3K|(^oKnuLl5}0Kkp2|Lp#M07=P+ zZcKtGZqi5y07yh~WBg`^i0r=-AkobUNXei8I$m-<33^F226aZ5kt1A6!#LUm%f!qt z;1p1P!(;~nfF%D@_CM+k6GV2Cl!gL;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ca3x~Z literal 0 HcmV?d00001 diff --git a/src/MediatR.ParallelPublisher/MediatR.ParallelPublisher.csproj b/src/MediatR.ParallelPublisher/MediatR.ParallelPublisher.csproj index 0892490..0d0f4ca 100644 --- a/src/MediatR.ParallelPublisher/MediatR.ParallelPublisher.csproj +++ b/src/MediatR.ParallelPublisher/MediatR.ParallelPublisher.csproj @@ -14,6 +14,12 @@ 10.0 true ..\..\MediatR.ParallelPublisher.snk + README.md + LICENSE + true + MediatR.ParallelPublisher + icon.jpg + 1.0.1 @@ -21,4 +27,14 @@ + + + + + + + + + +