forked from RicoSuter/NSwag
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
118 lines (104 loc) · 2.78 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
trigger:
branches:
include:
- master
- release
- refs/tags/*
pr:
- master
pool:
vmImage: 'windows-2019'
variables:
BuildConfiguration: Release
Projects: 'src/NSwag.sln'
steps:
- task: CmdLine@2
displayName: 'Allow long file path'
inputs:
script: 'git config --system core.longpaths true'
- checkout: self
# Install required SDKs and tools
- task: UseDotNet@2
displayName: 'Install .NET Core SDK'
inputs:
packageType: 'sdk'
version: '6.0.0'
includePreviewVersions: true
performMultiLevelLookup: true
useGlobalJson: true
- task: UseDotNet@2
displayName: 'Install .NET Core SDK'
inputs:
packageType: 'sdk'
version: '7.0.x'
includePreviewVersions: true
performMultiLevelLookup: true
useGlobalJson: true
- task: UseDotNet@2
displayName: 'Install .NET Core SDK'
inputs:
packageType: 'sdk'
version: '8.0.100'
includePreviewVersions: true
performMultiLevelLookup: true
useGlobalJson: true
- task: CmdLine@2
displayName: 'Install DNT'
inputs:
script: 'npm i -g dotnettools'
- task: CmdLine@2
displayName: 'Install WiX Toolset'
inputs:
script: 'choco install wixtoolset'
- task: CmdLine@2
displayName: 'Patch project version (preview)'
condition: and(succeeded(), ne(variables['Build.SourceBranch'], 'refs/heads/release'))
inputs:
script: 'dnt bump-versions preview "$(Build.BuildNumber)"'
failOnStderr: true
- task: DotNetCoreCLI@2
displayName: 'Restore packages'
inputs:
command: 'restore'
projects: '$(Projects)'
includeNuGetOrg: true
# Build and test
- task: MSBuild@1
displayName: 'Build solution'
inputs:
solution: '$(Projects)'
msbuildArchitecture: 'x86'
configuration: '$(BuildConfiguration)'
- task: VSTest@2
displayName: 'Run tests'
inputs:
testSelector: 'testAssemblies'
testAssemblyVer2: |
**\*test*.dll
!**\*TestAdapter.dll
!**\*Integration*.dll
!**\obj\**
searchFolder: '$(System.DefaultWorkingDirectory)'
configuration: '$(BuildConfiguration)'
# Publish artifacts
- task: CopyFiles@2
displayName: 'Copy packages'
# condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
inputs:
Contents: '**/*.nupkg'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
flattenFolders: true
- task: CopyFiles@2
displayName: 'Copy MSI'
# condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
inputs:
Contents: '**/*.msi'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
flattenFolders: true
- task: PublishBuildArtifacts@1
displayName: 'Publish artifacts'
# condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'