-
Notifications
You must be signed in to change notification settings - Fork 300
/
azure-pipelines.yml
73 lines (58 loc) · 1.93 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
trigger:
- main
- dev/*
- rel/*
pr:
- main
- dev/*
- rel/*
pool:
vmImage: windows-latest
variables:
Build.Configuration: Release
jobs:
- job: BuildBits
displayName: Build and Test solution
timeoutInMinutes: 60
steps:
# Set Build Version
- script: nbgv cloud
displayName: Set NBGV version
# Restore solution
- script: dotnet restore -p:Configuration=$(Build.Configuration)
displayName: Restore solution
# Build solution
- script: dotnet build --no-restore -c $(Build.Configuration)
displayName: Build solution
# Test solution #
# Run .NET 8 unit tests
- script: dotnet test --no-build -c $(Build.Configuration) -f net8.0 -l "trx;LogFileName=VSTestResults_net8.0.trx"
displayName: Run .NET 8 unit tests
# Run .NET 7 unit tests
- script: dotnet test --no-build -c $(Build.Configuration) -f net7.0 -l "trx;LogFileName=VSTestResults_net7.0.trx"
displayName: Run .NET 7 unit tests
# Run .NET Framework 4.7.2 unit tests
- script: dotnet test --no-build -c $(Build.Configuration) -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: '**/TestResults/VSTestResults*.trx'
condition: always()
# Pack solution
- script: dotnet pack --no-build -c $(Build.Configuration)
displayName: Pack solution
# Sign packages
- pwsh: build/Sign-Package.ps1
displayName: Authenticode sign packages
env:
SignClientUser: $(SignClientUser)
SignClientSecret: $(SignClientSecret)
ArtifactDirectory: bin/nupkg
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'), ne(variables['SignClientUser'], ''), ne(variables['SignClientSecret'], ''))
# Publish build artifacts
- publish: bin/nupkg
artifact: Packages
displayName: Publish package artifacts