Skip to content

Commit 0f062c5

Browse files
committed
Update to VS2022 worker image, pwsh
1 parent b32bb6a commit 0f062c5

File tree

2 files changed

+12
-20
lines changed

2 files changed

+12
-20
lines changed

Build.ps1

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,41 +11,33 @@ if(Test-Path .\artifacts) {
1111

1212
$branch = @{ $true = $env:APPVEYOR_REPO_BRANCH; $false = $(git symbolic-ref --short -q HEAD) }[$env:APPVEYOR_REPO_BRANCH -ne $NULL];
1313
$revision = @{ $true = "{0:00000}" -f [convert]::ToInt32("0" + $env:APPVEYOR_BUILD_NUMBER, 10); $false = "local" }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
14-
$suffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10,$branch.Length)))-$revision"}[$branch -eq "master" -and $revision -ne "local"]
14+
$suffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10,$branch.Length)))-$revision"}[$branch -eq "main" -and $revision -ne "local"]
15+
$commitHash = $(git rev-parse --short HEAD)
16+
$buildSuffix = @{ $true = "$($suffix)-$($commitHash)"; $false = "$($branch)-$($commitHash)" }[$suffix -ne ""]
1517

16-
echo "build: Version suffix is $suffix"
18+
echo "build: Package version suffix is $suffix"
19+
echo "build: Build version suffix is $buildSuffix"
1720

1821
foreach ($src in ls src/*) {
1922
Push-Location $src
2023

21-
echo "build: Packaging project in $src"
24+
echo "build: Packaging project in $src"
2225

26+
& dotnet build -c Release --version-suffix=$buildSuffix -p:EnableSourceLink=true
2327
if ($suffix) {
24-
& dotnet pack -c Release -o ..\..\artifacts --version-suffix=$suffix --include-source
28+
& dotnet pack -c Release -o ..\..\artifacts --version-suffix=$suffix --no-build
2529
} else {
26-
& dotnet pack -c Release -o ..\..\artifacts --include-source
30+
& dotnet pack -c Release -o ..\..\artifacts --no-build
2731
}
28-
2932
if($LASTEXITCODE -ne 0) { exit 1 }
3033

3134
Pop-Location
3235
}
3336

34-
foreach ($test in ls test/*.PerformanceTests) {
35-
Push-Location $test
36-
37-
echo "build: Building performance test project in $test"
38-
39-
& dotnet build -c Release
40-
if($LASTEXITCODE -ne 0) { exit 2 }
41-
42-
Pop-Location
43-
}
44-
4537
foreach ($test in ls test/*.Tests) {
4638
Push-Location $test
4739

48-
echo "build: Testing project in $test"
40+
echo "build: Testing project in $test"
4941

5042
& dotnet test -c Release
5143
if($LASTEXITCODE -ne 0) { exit 3 }

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
version: '{build}'
22
skip_tags: true
3-
image: Visual Studio 2019
3+
image: Visual Studio 2022
44
build_script:
5-
- ps: ./Build.ps1
5+
- pwsh: ./Build.ps1
66
test: off
77
artifacts:
88
- path: artifacts/Serilog.*.nupkg

0 commit comments

Comments
 (0)