forked from CommunityToolkit/dotnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
81 lines (66 loc) · 2.01 KB
/
azure-pipelines.yml
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
trigger:
- main
- dev/*
- rel/*
pr:
- main
- dev/*
- rel/*
pool:
vmImage: windows-2022
jobs:
- job: BuildBits
timeoutInMinutes: 60
steps:
# Install NuGet
- task: NuGetToolInstaller@0
displayName: Install NuGet 6.0
inputs:
versionSpec: 6.0.0
# Install NerdBank GitVersioning
- task: DotNetCoreCLI@2
displayName: Install NBGV tool
inputs:
command: custom
custom: tool
arguments: update -g nbgv
# Set Build Version
- script: nbgv cloud
displayName: Set NBGV version
# Verify headers
- pwsh: build/Update-Headers.ps1 -Verify
displayName: Verify headers
# Build solution
- script: dotnet build -c Release
displayName: Build solution
# Run .NET 6 tests
- script: dotnet test -c Release -f net6.0 -l "trx;LogFileName=VSTestResults_net6.0.trx"
displayName: Run .NET 6 unit tests
# Run .NET Core 3.1 tests
- script: dotnet test -c Release -f netcoreapp3.1 -l "trx;LogFileName=VSTestResults_netcoreapp3.1.trx"
displayName: Run .NET Core 3.1 unit tests
# Run .NET Framework 4.7.2 tests
- script: dotnet test -c Release -f net472 -l "trx;LogFileName=VSTestResults_net472.trx"
displayName: Run .NET Framework 4.7.2 unit tests
# Publish test results
- task: PublishTestResults@2
displayName: Publish test results
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: '**/VSTestResults*.trx'
condition: always()
# Create the NuGet package(s)
- script: dotnet pack -c Release
displayName: Create NuGet package(s)
# Sign package(s)
- pwsh: build/Sign-Package.ps1
displayName: Authenticode sign packages
env:
SignClientUser: $(SignClientUser)
SignClientSecret: $(SignClientSecret)
ArtifactDirectory: bin/nupkg
condition: and(succeeded(), not(eq(variables['Build.Reason'], 'PullRequest')), not(eq(variables['SignClientSecret'], '')), not(eq(variables['SignClientUser'], '')))
# Publish build artifacts
- publish: bin/nupkg
artifact: Packages
displayName: Publish package artifacts