-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
163 lines (145 loc) · 5.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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
name: $(BuildID)
trigger:
branches:
include:
- master
schedules:
- cron: "1 0 * * 1"
displayName: 'Weekly build'
always: true
branches:
include:
- master
variables:
Agent: 'ubuntu-latest'
BuildConfiguration: 'Release' # configuration to pack, does not work with build step
Windowsx64: 'win-x64'
Windowsx86: 'win-x86'
Linux64: 'linux-x64'
OSXx64: 'osx-x64'
stages:
- stage: CI
displayName: 'Build and run tests'
jobs:
- job: ci
displayName: 'Build and run tests'
pool:
vmImage: $(Agent)
steps:
- task: DotNetCoreCLI@2
displayName: 'Build'
inputs:
command: build
arguments: '--configuration Release /p:PublishSingleFile=false'
projects: 'ChessComTournamentAggregator.sln'
- task: DotNetCoreCLI@2
displayName: 'Run tests'
inputs:
command: test
arguments: '--configuration Release --no-build --logger trx --collect "Code coverage"'
nobuild: true
projects: '**/*.Test.csproj'
publishTestResults: true
- stage: CD
displayName: 'Generate and publish artifacts'
dependsOn: 'CI'
condition: and(succeeded('CI'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
jobs:
- job: cd
displayName: 'Generate and publish artifacts'
pool:
vmImage: $(Agent)
steps:
- checkout: self
persistCredentials: true
clean: true
- task: NuGetToolInstaller@1
displayName: 'Setup NuGet'
inputs:
versionSpec: '5.3.1'
checkLatest: true
- task: DotNetCoreCLI@2
displayName: 'Build'
inputs:
command: 'build'
arguments: '--configuration Release /p:PublishSingleFile=false'
projects: 'ChessComTournamentAggregator.sln'
- task: DotNetCoreCLI@2
displayName: 'Generate NuGet package'
inputs:
command: 'pack'
arguments: '--configuration Release'
configuration: '$(BuildConfiguration)'
packagesToPack: '**/*ChessComTournamentAggregator.csproj'
nobuild: true
packDirectory: '$(Build.SourcesDirectory)/ChessComTournamentAggregator/Artifacts'
versioningScheme: 'off'
- task: DotNetCoreCLI@2
displayName: 'Generate executable for $(Windowsx64)'
inputs:
command: 'publish'
arguments: '--configuration Release --runtime $(Windowsx64) --output $(Build.SourcesDirectory)/ChessComTournamentAggregator/Artifacts/$(Windowsx64)'
configuration: '$(BuildConfiguration)'
projects: '**/*.App.csproj'
modifyOutputPath: false
publishWebProjects: false
zipAfterPublish: false
versioningScheme: 'off'
- task: DotNetCoreCLI@2
displayName: 'Generate executable for $(Windowsx86)'
inputs:
command: 'publish'
arguments: '--configuration Release --runtime $(Windowsx86) --output $(Build.SourcesDirectory)/ChessComTournamentAggregator/Artifacts/$(Windowsx86)'
configuration: '$(BuildConfiguration)'
projects: '**/*.App.csproj'
modifyOutputPath: false
publishWebProjects: false
zipAfterPublish: false
versioningScheme: 'off'
- task: DotNetCoreCLI@2
displayName: 'Generate executable for $(Linux64)'
inputs:
command: 'publish'
arguments: '--configuration Release --runtime $(Linux64) --output $(Build.SourcesDirectory)/ChessComTournamentAggregator/Artifacts/$(Linux64)'
configuration: '$(BuildConfiguration)'
projects: '**/*.App.csproj'
modifyOutputPath: false
publishWebProjects: false
zipAfterPublish: false
versioningScheme: 'off'
- task: DotNetCoreCLI@2
displayName: 'Generate executable for $(OSXx64)'
inputs:
command: 'publish'
arguments: '--configuration Release --runtime $(OSXx64) --output $(Build.SourcesDirectory)/ChessComTournamentAggregator/Artifacts/$(OSXx64)'
configuration: '$(BuildConfiguration)'
projects: '**/*.App.csproj'
modifyOutputPath: false
publishWebProjects: false
zipAfterPublish: false
versioningScheme: 'off'
- task: PublishBuildArtifacts@1
displayName: 'Publish artifacts: NuGet package and its symbols and app executables'
inputs:
pathtoPublish: '$(Build.SourcesDirectory)/ChessComTournamentAggregator/Artifacts/'
artifactName: 'ChessComTournamentAggregator'
- task: NuGetCommand@2
displayName: 'Push NuGet package'
condition: ne(variables['Build.Reason'], 'Schedule')
continueOnError: true
inputs:
command: 'push'
packagesToPush: '$(Build.SourcesDirectory)/ChessComTournamentAggregator/Artifacts/*.nupkg'
nuGetFeedType: 'external'
publishFeedCredentials: 'ChessComTournamentAggregator_NuGet'
verbosityPush: 'Detailed'
- task: NuGetCommand@2
displayName: 'Push GitHub package'
condition: ne(variables['Build.Reason'], 'Schedule')
continueOnError: true
inputs:
command: 'push'
packagesToPush: '$(Build.SourcesDirectory)/ChessComTournamentAggregator/Artifacts/*.nupkg'
nuGetFeedType: 'external'
publishFeedCredentials: 'GitHubPackageRegistry'
verbosityPush: 'Detailed'