-
-
Notifications
You must be signed in to change notification settings - Fork 80
/
Copy pathazure-pipelines.yml
133 lines (130 loc) · 4.16 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# Azure Pipelines documentation https://aka.ms/yaml
trigger:
branches:
include:
- '*'
tags:
include:
- '*'
variables:
# Set the DOTNET_SKIP_FIRST_TIME_EXPERIENCE environment variable to stop wasting time caching packages
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
# Disable sending usage data to Microsoft
DOTNET_CLI_TELEMETRY_OPTOUT: true
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 SDK'
inputs:
packageType: 'sdk'
version: '3.0.100'
- script: 'dotnet tool install --global Cake.Tool'
displayName: 'Install Cake Tool'
failOnStderr: true
- script: 'dotnet cake --target=Build'
displayName: 'Dotnet Cake Build'
failOnStderr: true
- script: 'dotnet cake --target=Test'
displayName: 'Dotnet Cake Test'
failOnStderr: true
- script: 'dotnet cake --target=Pack'
displayName: 'Dotnet Cake Pack'
failOnStderr: true
- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: '**/*.trx'
- publish: './Artefacts'
artifact: $(matrixName)
displayName: 'Publish Artefacts'
- stage: Deploy
jobs:
- deployment: AzureArtefacts
displayName: 'Azure Artefacts'
pool:
vmImage: ubuntu-latest
environment: 'Azure Artefacts'
strategy:
runOnce:
deploy:
steps:
- checkout: self
- task: UseDotNet@2
displayName: 'Install .NET Core SDK'
inputs:
packageType: 'sdk'
version: '3.0.100'
- task: NuGetToolInstaller@1
displayName: 'Install NuGet'
- task: NuGetAuthenticate@0
- script: 'dotnet tool install --global Cake.Tool'
displayName: 'Install Cake Tool'
failOnStderr: true
- script: 'dotnet cake --target=PushAzureArtefacts --AzureArtefactsOrganization=RehanSaeed --Verbosity=Diagnostic'
displayName: 'Dotnet Cake PushAzureArtefacts'
failOnStderr: true
- deployment: GitHub
pool:
vmImage: ubuntu-latest
environment: 'GitHub'
strategy:
runOnce:
deploy:
steps:
- checkout: self
- task: UseDotNet@2
displayName: 'Install .NET Core SDK'
inputs:
packageType: 'sdk'
version: '3.0.100'
- task: NuGetToolInstaller@1
displayName: 'Install NuGet'
- script: 'dotnet tool install --global Cake.Tool'
displayName: 'Install Cake Tool'
failOnStderr: true
- script: 'dotnet cake --target=PushGitHub --GitHubUserName=$(GitHubUserName) --GitHubPassword=$(GitHubPersonalAccessToken) --Verbosity=Diagnostic'
displayName: 'Dotnet Cake PushGitHub'
failOnStderr: true
- deployment: NuGet
pool:
vmImage: ubuntu-latest
environment: 'NuGet'
condition: startsWith(variables['Build.sourceBranch'], 'refs/tags/')
strategy:
runOnce:
deploy:
steps:
- checkout: self
- task: UseDotNet@2
displayName: 'Install .NET Core SDK'
inputs:
packageType: 'sdk'
version: '3.0.100'
- task: NuGetToolInstaller@1
displayName: 'Install NuGet'
- script: 'dotnet tool install --global Cake.Tool'
displayName: 'Install Cake Tool'
failOnStderr: true
- script: 'dotnet cake --target=PushNuGet --NuGetApiKey=$(NuGetApiKey) --Verbosity=Diagnostic'
displayName: 'Dotnet Cake PushNuGet'
failOnStderr: true