-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Danijel Peric
committed
Mar 26, 2023
1 parent
2c1b191
commit 7eb7e58
Showing
6 changed files
with
77 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<packageSources> | ||
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" /> | ||
</packageSources> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters