This repository has been archived by the owner on Apr 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathBuild.ps1
66 lines (60 loc) · 2 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/env pwsh
Push-Location $PSScriptRoot
try
{
# Build Prototest.
dotnet build -c Release
if ($LASTEXITCODE -ne 0)
{
exit $LASTEXITCODE
}
# Test running the example directly.
$env:TEST_ENVIRONMENT="production"
dotnet .\Prototest.Example\bin\Release\netcoreapp2.1\Prototest.Example.dll -c Functional
if ($LASTEXITCODE -ne 0)
{
exit $LASTEXITCODE
}
$env:TEST_ENVIRONMENT=$null
# Test running the example via dotnet test.
$env:TEST_ENVIRONMENT="production"
dotnet test -c Release .\Prototest.Example\Prototest.Example.csproj
if ($LASTEXITCODE -ne 0)
{
exit $LASTEXITCODE
}
$env:TEST_ENVIRONMENT=$null
# Test running the example via dotnet vstest.
dotnet vstest .\Prototest.Example\bin\Release\netcoreapp2.1\Prototest.Example.dll "--logger:console;verbosity=normal" -- Env.TEST_ENVIRONMENT=production
if ($LASTEXITCODE -ne 0)
{
exit $LASTEXITCODE
}
# The package version to use.
$PackageVersion=$env:APPVEYOR_BUILD_VERSION
if ("$PackageVersion" -eq "")
{
$PackageVersion="1.6.3-DEV"
}
# Create the NuGet packages.
dotnet pack -c Release --no-build --no-restore /p:NuspecProperties=version=$PackageVersion /p:NuspecFile=..\Prototest.nuspec .\Prototest.Library\Prototest.Library.csproj
if ($LASTEXITCODE -ne 0)
{
exit $LASTEXITCODE
}
dotnet pack -c Release --no-build --no-restore /p:NuspecProperties=version=$PackageVersion /p:NuspecFile=..\Prototest.Runtime.nuspec .\Prototest.Library\Prototest.Library.csproj
if ($LASTEXITCODE -ne 0)
{
exit $LASTEXITCODE
}
dotnet pack -c Release --no-build --no-restore /p:NuspecProperties=version=$PackageVersion /p:NuspecFile=..\Prototest.EntryPoint.nuspec .\Prototest.Library\Prototest.Library.csproj
if ($LASTEXITCODE -ne 0)
{
exit $LASTEXITCODE
}
Move-Item -Force .\Prototest.Library\bin\Release\Prototest.*.nupkg .\
}
finally
{
Pop-Location
}