forked from OmniSharp/omnisharp-roslyn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
263 lines (251 loc) · 8.41 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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
parameters:
- name: testProjects
type: object
default:
- OmniSharp.DotNetTest.Tests
- OmniSharp.MSBuild.Tests,OmniSharp.Roslyn.CSharp.Tests,OmniSharp.Cake.Tests,OmniSharp.Script.Tests,OmniSharp.Stdio.Tests,OmniSharp.Http.Tests,OmniSharp.Tests,OmniSharp.Lsp.Tests
trigger:
batch: 'true'
branches:
include:
- master
- refs/tags/*
pr:
autoCancel: 'true'
branches:
include:
- master
resources:
repositories:
- repository: rsg
type: github
name: RocketSurgeonsGuild/AzureDevopsTemplates
ref: refs/tags/v0.4.5
endpoint: github
variables:
Verbosity: Diagnostic
DotNetVersion: "5.0.101"
DotNetVersion2: "3.1.403"
CakeVersion: "0.32.1"
NuGetVersion: "4.9.2"
GitVersionVersion: "5.0.1"
MonoVersion: "6.12.0"
Coverage: "$(Agent.BuildDirectory)/c"
VstsCoverage: "$(Coverage)"
Artifacts: $(Build.SourcesDirectory)/artifacts/
VstsArtifacts: "$(Artifacts)"
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: "true"
jobs:
- job: GitVersion
pool:
vmImage: "windows-2019"
steps:
- template: gitversion/store.yml@rsg
parameters:
NuGetVersion: $(NuGetVersion)
version: $(GitVersionVersion)
- job: macOS
pool:
vmImage: "macOS-10.15"
dependsOn: GitVersion
steps:
- template: ./.pipelines/init.yml
parameters:
Verbosity: $(Verbosity)
CakeVersion: $(CakeVersion)
DotNetVersion: $(DotNetVersion)
NuGetVersion: $(NuGetVersion)
MonoVersion: $(MonoVersion)
- script: |
echo $PATH
chmod 755 ./build.sh
./build.sh --configuration Release --verbosity Verbose --target CI --publish-all --archive
displayName: 'Build'
- template: ./.pipelines/artifacts.yml
parameters:
Artifacts: $(Artifacts)
- job: macOS_tests
pool:
vmImage: "macOS-10.15"
dependsOn: GitVersion
strategy:
matrix:
${{ each project in parameters.testProjects }}:
${{ project }}:
TEST_PROJECT: ${{ project }}
steps:
- template: ./.pipelines/init.yml
parameters:
Verbosity: $(Verbosity)
CakeVersion: $(CakeVersion)
DotNetVersion: $(DotNetVersion)
NuGetVersion: $(NuGetVersion)
MonoVersion: $(MonoVersion)
- script: |
echo $PATH
chmod 755 ./build.sh
./build.sh --configuration Debug --verbosity Verbose --target Test --test-project="$TEST_PROJECT"
displayName: 'Build'
- template: ./.pipelines/logs.yml
parameters:
Artifacts: $(Artifacts)
- job: Linux
pool:
vmImage: "ubuntu-18.04"
dependsOn: GitVersion
steps:
- template: ./.pipelines/init.yml
parameters:
Verbosity: $(Verbosity)
CakeVersion: $(CakeVersion)
DotNetVersion: $(DotNetVersion)
NuGetVersion: $(NuGetVersion)
MonoVersion: $(MonoVersion)
- script: |
chmod 755 ./build.sh
./build.sh --configuration Release --verbosity Verbose --target CI --publish-all --archive
displayName: 'Build'
- template: ./.pipelines/artifacts.yml
parameters:
Artifacts: $(Artifacts)
- job: Linux_tests
pool:
vmImage: "ubuntu-18.04"
dependsOn: GitVersion
strategy:
matrix:
${{ each project in parameters.testProjects }}:
${{ project }}:
TEST_PROJECT: ${{ project }}
steps:
- template: ./.pipelines/init.yml
parameters:
Verbosity: $(Verbosity)
CakeVersion: $(CakeVersion)
DotNetVersion: $(DotNetVersion)
NuGetVersion: $(NuGetVersion)
MonoVersion: $(MonoVersion)
- script: |
chmod 755 ./build.sh
./build.sh --configuration Debug --verbosity Verbose --target Test --test-project="$TEST_PROJECT"
displayName: 'Build'
- template: ./.pipelines/logs.yml
parameters:
Artifacts: $(Artifacts)
- job: Windows
pool:
vmImage: "windows-2019"
dependsOn: GitVersion
steps:
- template: ./.pipelines/init.yml
parameters:
Verbosity: $(Verbosity)
CakeVersion: $(CakeVersion)
DotNetVersion: $(DotNetVersion)
NuGetVersion: $(NuGetVersion)
- powershell: .\build.ps1 -configuration Release -verbosity Verbose -target CI -publish-all -archive
displayName: 'Build'
- template: ./.pipelines/artifacts.yml
parameters:
Artifacts: $(Artifacts)
- job: Windows_tests
pool:
vmImage: "windows-2019"
dependsOn: GitVersion
strategy:
matrix:
${{ each project in parameters.testProjects }}:
${{ project }}:
TEST_PROJECT: ${{ project }}
steps:
- template: ./.pipelines/init.yml
parameters:
Verbosity: $(Verbosity)
CakeVersion: $(CakeVersion)
DotNetVersion: $(DotNetVersion)
NuGetVersion: $(NuGetVersion)
- powershell: .\build.ps1 -configuration Debug -verbosity Verbose --test-project="$ENV:TEST_PROJECT" -target Test
displayName: 'Build'
- template: ./.pipelines/logs.yml
parameters:
Artifacts: $(Artifacts)
- job: Release
pool:
vmImage: "Ubuntu-16.04"
dependsOn:
- macOS
- macOS_tests
- Linux
- Linux_tests
- Windows
- Windows_tests
steps:
- task: NuGetToolInstaller@1
displayName: 'Install NuGet'
inputs:
versionSpec: $(NuGetVersion)
- task: DownloadBuildArtifacts@0
displayName: Download Packages
inputs:
downloadType: 'single'
artifactName: 'packages'
buildType: 'current'
downloadPath: '$(System.ArtifactsDirectory)'
- task: DownloadBuildArtifacts@0
displayName: Download Deployment
inputs:
downloadType: 'single'
artifactName: 'deployment'
buildType: 'current'
downloadPath: '$(System.ArtifactsDirectory)'
- task: DownloadBuildArtifacts@0
displayName: Download NuGet
inputs:
downloadType: 'single'
artifactName: 'nuget'
buildType: 'current'
downloadPath: '$(System.ArtifactsDirectory)'
- task: NuGetCommand@2
displayName: 'Push NuGet packages to myget.org'
inputs:
command: push
nuGetFeedType: external
packagesToPush: '$(System.ArtifactsDirectory)/nuget/**/*.nupkg'
publishFeedCredentials: myget.org
condition: and(succeeded(), or(startsWith(variables['Build.SourceBranch'], 'refs/tags/v'), eq(variables['Build.SourceBranch'], 'refs/heads/master')))
- task: NuGetCommand@2
displayName: 'Push NuGet packages to nuget.org'
inputs:
command: push
nuGetFeedType: external
packagesToPush: '$(System.ArtifactsDirectory)/nuget/**/*.nupkg'
publishFeedCredentials: nuget.org
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
- script: |
AZ_REPO=$(lsb_release -cs)
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" | \
sudo tee /etc/apt/sources.list.d/azure-cli.list
curl -L https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
sudo apt-get install apt-transport-https
sudo apt-get update && sudo apt-get install azure-cli
az storage blob upload-batch --destination "releases" --source "$(System.ArtifactsDirectory)/deployment/" --account-name roslynomnisharp --account-key $BLOB_KEY
displayName: Upload to Azure Storage
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
env:
BLOB_KEY: $(BLOB_KEY)
- task: GitHubRelease@0
displayName: 'GitHub release (edit)'
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
inputs:
gitHubConnection: github
repositoryName: OmniSharp/omnisharp-roslyn
action: edit
tag: '$(Build.SourceBranchName)'
title: '$(Build.SourceBranchName)'
assets: '$(System.ArtifactsDirectory)/packages/**/*'
assetUploadMode: replace
# releaseNotesSource: input
# releaseNotes: asdfasdf12
# isDraft: true
# isPreRelease: true
# addChangeLog: false