Commit ae431aaf authored by m0sa's avatar m0sa

restore, build and test in release configuration, don't (re-)build on test and pack

parent a4712007
......@@ -7,16 +7,16 @@ $packageOutputFolder = "$PSScriptRoot\.nupkgs"
# Restore packages and build product
Write-Host "Restoring..." -ForegroundColor "Green"
& dotnet msbuild /t:Restore /nologo /m /v:m "/p:PackageVersionSuffix=$PreReleaseSuffix" # Restore all packages
& dotnet msbuild /t:Restore /nologo /m /v:m "/p:Configuration=Release" "/p:PackageVersionSuffix=$PreReleaseSuffix" # Restore all packages
if ($LASTEXITCODE -ne 0)
{
throw "dotnet restore failed with exit code $LASTEXITCODE"
throw "restore failed with exit code $LASTEXITCODE"
}
if ($PreReleaseSuffix) {
& dotnet build --version-suffix "$PreReleaseSuffix"
& dotnet build -c Release --version-suffix "$PreReleaseSuffix"
} else {
& dotnet build
& dotnet build -c Release
}
# Run tests
......@@ -29,13 +29,13 @@ else
Write-Host "Running Tests..." -ForegroundColor "Green"
Get-ChildItem "Dapper.Test*.csproj" -Recurse |
ForEach-Object {
& dotnet test "$_"
& dotnet test "$_" -c Release --no-build
}
}
# Package all
if ($PreReleaseSuffix) {
& dotnet pack -c Release -o "$packageOutputFolder" --version-suffix "$PreReleaseSuffix"
& dotnet pack -c Release -o "$packageOutputFolder" --no-build --version-suffix "$PreReleaseSuffix"
} else {
& dotnet pack -c Release -o "$packageOutputFolder"
& dotnet pack -c Release -o "$packageOutputFolder" --no-build
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment