-
-
Notifications
You must be signed in to change notification settings - Fork 78
/
azure-pipelines.yml
103 lines (100 loc) · 3.26 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Azure Pipelines documentation https://aka.ms/yaml
trigger:
branches:
include:
- "main"
tags:
include:
- "*"
pr:
branches:
include:
- "*"
variables:
# Disable the .NET logo in the console output.
DOTNET_NOLOGO: true
# Disable the .NET first time experience to skip caching NuGet packages and speed up the build.
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
# Disable sending .NET CLI telemetry to Microsoft.
DOTNET_CLI_TELEMETRY_OPTOUT: true
# Set the build number in MinVer.
MINVERBUILDMETADATA: build.$(Build.BuildId)
stages:
- stage: Build
jobs:
- job: Build
strategy:
matrix:
Linux:
matrixName: Ubuntu
vmImageName: ubuntu-latest
Mac:
matrixName: Mac
vmImageName: macos-latest
Windows:
matrixName: Windows
vmImageName: windows-latest
pool:
vmImage: $(vmImageName)
timeoutInMinutes: 10
steps:
- checkout: self
lfs: true
- task: UseDotNet@2
displayName: "Install .NET Core 3.1 SDK"
inputs:
packageType: "sdk"
version: 3.1.x
- task: UseDotNet@2
displayName: "Install .NET Core 6.0 SDK"
inputs:
packageType: "sdk"
version: 6.0.x
- task: UseDotNet@2
displayName: "Install .NET Core SDK"
inputs:
packageType: "sdk"
useGlobalJson: true
- pwsh: "dotnet tool restore"
displayName: "Dotnet Tool Restore"
failOnStderr: true
- pwsh: "dotnet cake --target=Build"
displayName: "Dotnet Cake Build"
failOnStderr: true
- pwsh: "dotnet cake --target=Test"
displayName: "Dotnet Cake Test"
failOnStderr: true
- pwsh: "dotnet cake --target=Pack"
displayName: "Dotnet Cake Pack"
failOnStderr: true
- task: PublishTestResults@2
displayName: "Publish Test Results"
inputs:
testResultsFormat: "VSTest"
testResultsFiles: "**/*.trx"
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: cobertura
summaryFileLocation: "**/*.cobertura.xml"
- publish: "./Artefacts"
artifact: $(matrixName)
displayName: "Publish Artefacts"
- stage: Deploy
jobs:
- deployment: AzureArtefacts
displayName: "Azure Artefacts"
condition: ne(variables['Build.Reason'], 'PullRequest')
pool:
vmImage: windows-latest
environment: "Azure Artefacts"
strategy:
runOnce:
deploy:
steps:
- task: NuGetToolInstaller@1
displayName: "NuGet Install"
- task: NuGetAuthenticate@0
displayName: "NuGet Authenticate"
- pwsh: nuget push $(Agent.BuildDirectory)\Windows\*.nupkg -Source https://pkgs.dev.azure.com/dotnet-boxed/_packaging/dotnet-boxed/nuget/v3/index.json -ApiKey AzureArtifacts -SkipDuplicate
displayName: "NuGet Push"
failOnStderr: true