-
Notifications
You must be signed in to change notification settings - Fork 151
/
build.ps1
39 lines (31 loc) · 1.66 KB
/
build.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# restore and builds all projects as release.
# creates NuGet package at \artifacts
dotnet --version
$versionPrefix = "5.3.14"
$versionSuffix = ""
$versionFile = $versionPrefix + "." + ${env:APPVEYOR_BUILD_NUMBER}
$versionProduct = $versionPrefix;
if ($env:APPVEYOR_PULL_REQUEST_NUMBER) {
$versionPrefix = $versionFile
$versionSuffix = "PR" + $env:APPVEYOR_PULL_REQUEST_NUMBER
}
if (-Not $versionSuffix.Equals("")) {
$versionProduct = $versionProduct + "-" + $versionSuffix
}
dotnet restore .\src\NLog.Extensions.Logging\
if (-Not $LastExitCode -eq 0) {
exit $LastExitCode
}
dotnet restore .\src\NLog.Extensions.Hosting\
if (-Not $LastExitCode -eq 0) {
exit $LastExitCode
}
msbuild /t:Pack .\src\NLog.Extensions.Logging\ /p:targetFrameworks='"net461;netstandard1.3;netstandard1.5;netstandard2.0;netstandard2.1;net6.0;net8.0"' /p:VersionPrefix=$versionPrefix /p:VersionSuffix=$versionSuffix /p:FileVersion=$versionFile /p:ProductVersion=$versionProduct /p:Configuration=Release /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg /p:PackageOutputPath=..\..\artifacts /verbosity:minimal /p:ContinuousIntegrationBuild=true
if (-Not $LastExitCode -eq 0) {
exit $LastExitCode
}
msbuild /t:Pack .\src\NLog.Extensions.Hosting\ /p:targetFrameworks='"netstandard2.0;netstandard2.1;net6.0;net8.0"' /p:VersionPrefix=$versionPrefix /p:VersionSuffix=$versionSuffix /p:FileVersion=$versionFile /p:ProductVersion=$versionProduct /p:Configuration=Release /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg /p:PackageOutputPath=..\..\artifacts /verbosity:minimal /p:ContinuousIntegrationBuild=true
if (-Not $LastExitCode -eq 0) {
exit $LastExitCode
}
exit $LastExitCode