forked from microsoft/wslg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
432 lines (362 loc) · 14.8 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
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
resources:
repositories:
- repository: FreeRDP
type: github
endpoint: GitHub connection 1
name: microsoft/FreeRDP-mirror
ref: working
- repository: weston
type: github
endpoint: GitHub connection 1
name: microsoft/weston-mirror
ref: working
- repository: pulseaudio
type: github
endpoint: GitHub connection 1
name: microsoft/pulseaudio-mirror
ref: working
trigger:
- main
stages:
- stage: Build_SystemDistro
displayName: "Build System Distro (x64 and ARM64)"
jobs:
- job: 'Build_Ubuntu_x64'
displayName: 'Build x64 system distro'
timeoutInMinutes: 200
variables:
- group: 'Keys'
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: FreeRDP
- checkout: weston
- checkout: pulseaudio
- checkout: self
- template: devops/common-linux.yml
- script: wget https://cblmarinerstorage.blob.core.windows.net/sources/core/mesa-21.0.0.tar.xz &&
tar -xvf mesa-21.0.0.tar.xz
displayName: 'Download Mesa from CBL Mariner'
- script: mv FreeRDP-mirror/ wslg/vendor/FreeRDP &&
mv weston-mirror/ wslg/vendor/weston &&
mv pulseaudio-mirror/ wslg/vendor/pulseaudio &&
mv mesa-21.0.0/ wslg/vendor/mesa
displayName: 'Move sub projects (FreeRDP, Weston, PulseAudio, Mesa)'
- script: docker build -f ./wslg/Dockerfile -t system-distro-x64
./wslg
--build-arg WSLG_VERSION=`gitversion /targetpath ./wslg /showvariable InformationalVersion`
--build-arg WSLG_ARCH=x86_64
displayName: 'Create System Distro Docker image Mariner-x64'
- script: docker export `docker create system-distro-x64` > $(Agent.BuildDirectory)/system_x64.tar
displayName: 'Create system_x64.tar'
- script: docker build -f ./wslg/Dockerfile -t system-distro-dev-x64
./wslg
--build-arg WSLG_VERSION=`gitversion /targetpath ./wslg /showvariable InformationalVersion`
--build-arg WSLG_ARCH=x86_64
--target dev
displayName: 'Create System Distro Dev Docker image Mariner-x64'
- script: docker cp `docker create system-distro-dev-x64 /bin/bash`:/work/debuginfo/system-debuginfo.tar.gz $(Agent.BuildDirectory)/system-debuginfo_x64.tar.gz
displayName: 'Copy system-debuginfo_x64.tar.gz'
- task: Go@0
inputs:
command: 'custom'
customCommand: 'run'
arguments: 'tar2ext4.go -vhd -i $(Agent.BuildDirectory)/system_x64.tar -o $(Agent.BuildDirectory)/system_x64.vhd'
workingDirectory: 'hcsshim/cmd/tar2ext4'
displayName: 'Create system_x64.vhd'
- task: PublishPipelineArtifact@1
displayName: 'Publish system_x64.vhd artifact'
inputs:
targetPath: $(Agent.BuildDirectory)/system_x64.vhd
artifact: 'system_x64.vhd'
publishLocation: 'pipeline'
- task: Go@0
inputs:
command: 'custom'
customCommand: 'run'
arguments: 'tar2ext4.go -i $(Agent.BuildDirectory)/system_x64.tar -o $(Agent.BuildDirectory)/system_x64.img'
workingDirectory: 'hcsshim/cmd/tar2ext4'
displayName: 'Create system_x64.img'
- task: PublishPipelineArtifact@1
displayName: 'Publish system_x64.img artifact'
inputs:
targetPath: $(Agent.BuildDirectory)/system_x64.img
artifact: 'system_x64.img'
publishLocation: 'pipeline'
- task: PublishPipelineArtifact@1
displayName: 'Publish system-debuginfo_x64.tar.gz artifact'
inputs:
targetPath: $(Agent.BuildDirectory)/system-debuginfo_x64.tar.gz
artifact: 'system-debuginfo_x64.tar.gz'
publishLocation: 'pipeline'
- job: 'Build_Windows_x64'
dependsOn: 'Build_Ubuntu_x64'
displayName: 'Build WSLDCV (x64) Plugin'
pool:
vmImage: 'windows-2019'
demands:
- msbuild
- visualstudio
steps:
- checkout: self
- template: devops/common-win.yml
- task: PowerShell@2
displayName: 'Update WSLDVCPlugin version'
inputs:
targetType: filePath
workingDirectory: './WSLDVCPlugin'
filePath: .\WSLDVCPlugin\UpdateRCVersion.ps1
pwsh: true
- task: MSBuild@1
displayName: 'Build RDP Plugin (x64)'
inputs:
solution: './WSLDVCPlugin/WSLDVCPlugin.sln'
platform: 'x64'
configuration: 'Release'
- script: 'MOVE WSLDVCPlugin\x64\Release\WSLDVCPlugin.pdb package\WSLDVCPlugin_x64.pdb'
displayName: 'Move plugin PDB to package (x64)'
- task: PublishPipelineArtifact@1
displayName: 'Publish WSLDVCPlugin PDB (x64)'
inputs:
targetPath: package\WSLDVCPlugin_x64.pdb
artifact: 'WSLDVCPlugin.x64.pdb'
publishLocation: 'pipeline'
- script: 'MOVE WSLDVCPlugin\x64\Release\WSLDVCPlugin.dll package\WSLDVCPlugin_x64.dll'
displayName: 'Move plugin DLL to package (x64)'
- task: PublishPipelineArtifact@1
displayName: 'Publish WSLDVCPlugin DLL (x64)'
inputs:
targetPath: package\WSLDVCPlugin_x64.dll
artifact: 'WSLDVCPlugin.x64.dll'
publishLocation: 'pipeline'
- job: 'Build_Ubuntu_ARM64'
displayName: 'Build ARM64 system distro'
condition: eq(variables['Build.SourceBranch'], 'refs/heads/main')
timeoutInMinutes: 200
variables:
- group: 'Keys'
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: FreeRDP
- checkout: weston
- checkout: pulseaudio
- checkout: self
- template: devops/common-linux.yml
- bash: |
curl -L -o ~/.docker/cli-plugins/docker-buildx --create-dirs ${BUILDX_URL}
chmod a+x ~/.docker/cli-plugins/docker-buildx
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
~/.docker/cli-plugins/docker-buildx create --use
~/.docker/cli-plugins/docker-buildx inspect --bootstrap
displayName: Prepare buildx
condition: eq(variables['Build.SourceBranch'], 'refs/heads/main')
env:
BUILDX_URL: https://github.com/docker/buildx/releases/download/v0.5.1/buildx-v0.5.1.linux-amd64
- script: |
echo '{ "experimental": true }' | sudo tee /etc/docker/daemon.json
sudo service docker restart
displayName: 'Enable Docker Engine experimental '
- script: wget https://cblmarinerstorage.blob.core.windows.net/sources/core/mesa-21.0.0.tar.xz &&
tar -xvf mesa-21.0.0.tar.xz
displayName: 'Download Mesa from CBL Mariner'
- script: mv FreeRDP-mirror/ wslg/vendor/FreeRDP &&
mv weston-mirror/ wslg/vendor/weston &&
mv pulseaudio-mirror/ wslg/vendor/pulseaudio &&
mv mesa-21.0.0/ wslg/vendor/mesa
displayName: 'Move sub projects (FreeRDP, Weston, PulseAudio, Mesa)'
- script: ~/.docker/cli-plugins/docker-buildx build -f ./wslg/Dockerfile
--output type=tar,dest=$(Agent.BuildDirectory)/system_arm64.tar
--platform=linux/arm64
./wslg
--build-arg WSLG_VERSION=`gitversion /targetpath ./wslg /showvariable InformationalVersion`
--build-arg WSLG_ARCH=aarch64
displayName: 'Create system_arm64.tar'
- task: Go@0
inputs:
command: 'custom'
customCommand: 'run'
arguments: 'tar2ext4.go -vhd -i $(Agent.BuildDirectory)/system_arm64.tar -o $(Agent.BuildDirectory)/system_arm64.vhd'
workingDirectory: 'hcsshim/cmd/tar2ext4'
displayName: 'Create system_arm64.vhd'
- task: PublishPipelineArtifact@1
displayName: 'Publish system_arm64.vhd artifact'
condition: eq(variables['Build.SourceBranch'], 'refs/heads/main')
inputs:
targetPath: $(Agent.BuildDirectory)/system_arm64.vhd
artifact: 'system_arm64.vhd'
publishLocation: 'pipeline'
- task: Go@0
inputs:
command: 'custom'
customCommand: 'run'
arguments: 'tar2ext4.go -i $(Agent.BuildDirectory)/system_arm64.tar -o $(Agent.BuildDirectory)/system_arm64.img'
workingDirectory: 'hcsshim/cmd/tar2ext4'
displayName: 'Create system_arm64.img'
- task: PublishPipelineArtifact@1
displayName: 'Publish system_arm64.img artifact'
condition: eq(variables['Build.SourceBranch'], 'refs/heads/main')
inputs:
targetPath: $(Agent.BuildDirectory)/system_arm64.img
artifact: 'system_arm64.img'
publishLocation: 'pipeline'
- script: mkdir ./dev &&
~/.docker/cli-plugins/docker-buildx build -f ./wslg/Dockerfile
--output type=tar,dest=./dev/dev_build.tar
--target=dev
--platform=linux/arm64
./wslg
--build-arg WSLG_VERSION=`gitversion /targetpath ./wslg /showvariable InformationalVersion`
--build-arg WSLG_ARCH=aarch64 &&
tar -xvf ./dev/dev_build.tar -C ./dev/ &&
mv ./dev/work/debuginfo/system-debuginfo.tar.gz $(Agent.BuildDirectory)/system-debuginfo_arm64.tar.gz
displayName: 'Copy system-debuginfo_arm64.tar.gz'
- task: PublishPipelineArtifact@1
displayName: 'Publish system-debuginfo_arm64.tar.gz artifact'
inputs:
targetPath: $(Agent.BuildDirectory)/system-debuginfo_arm64.tar.gz
artifact: 'system-debuginfo_arm64.tar.gz'
publishLocation: 'pipeline'
- job: 'Build_Windows_ARM64'
dependsOn: 'Build_Ubuntu_ARM64'
displayName: 'Build WSLDCV (ARM64) Plugin'
condition: eq(variables['Build.SourceBranch'], 'refs/heads/main')
pool:
vmImage: 'windows-2019'
demands:
- msbuild
- visualstudio
steps:
- checkout: self
- template: devops/common-win.yml
- task: PowerShell@2
displayName: 'Update WSLDVCPlugin version'
inputs:
targetType: filePath
workingDirectory: './WSLDVCPlugin'
filePath: .\WSLDVCPlugin\UpdateRCVersion.ps1
pwsh: true
- task: MSBuild@1
displayName: 'Build RDP Plugin (ARM64)'
inputs:
solution: './WSLDVCPlugin/WSLDVCPlugin.sln'
platform: 'ARM64'
configuration: 'Release'
- script: 'MOVE WSLDVCPlugin\ARM64\Release\WSLDVCPlugin.pdb package\WSLDVCPlugin_ARM64.pdb'
displayName: 'Move plugin PDB to package (ARM64)'
- task: PublishPipelineArtifact@1
displayName: 'Publish WSLDVCPlugin PDB (ARM64)'
inputs:
targetPath: package\WSLDVCPlugin_ARM64.pdb
artifact: 'WSLDVCPlugin.ARM64.pdb'
publishLocation: 'pipeline'
- script: 'MOVE WSLDVCPlugin\ARM64\Release\WSLDVCPlugin.dll package\WSLDVCPlugin_ARM64.dll'
displayName: 'Move plugin to package (ARM64)'
- task: PublishPipelineArtifact@1
displayName: 'Publish WSLDVCPlugin DLL (ARM64)'
inputs:
targetPath: package\WSLDVCPlugin_ARM64.dll
artifact: 'WSLDVCPlugin.ARM64.dll'
publishLocation: 'pipeline'
- stage: PublishPackage
displayName: "Publish WSLg NuGet Package"
jobs:
- job: 'Publish_UniversalPackage'
condition: eq(variables['Build.SourceBranch'], 'refs/heads/main')
displayName: 'Download artifact and push NuGet package'
pool:
vmImage: 'windows-2019'
steps:
- task: DownloadPipelineArtifact@2
displayName: 'Download system_x64.vhd'
inputs:
buildType: 'current'
artifactName: 'system_x64.vhd'
targetPath: 'package/'
- task: DownloadPipelineArtifact@2
displayName: 'Download system_x64.img'
inputs:
buildType: 'current'
artifactName: 'system_x64.img'
targetPath: 'package/'
- task: DownloadPipelineArtifact@2
displayName: 'Download system-debuginfo_x64.tar.gz'
inputs:
buildType: 'current'
artifactName: 'system-debuginfo_x64.tar.gz'
targetPath: 'package/'
- task: DownloadPipelineArtifact@2
displayName: 'Download WSLDVCPlugin DLL (x64)'
inputs:
buildType: 'current'
artifactName: 'WSLDVCPlugin.x64.dll'
targetPath: 'package/'
- task: DownloadPipelineArtifact@2
displayName: 'Download WSLDVCPlugin PDB (x64)'
inputs:
buildType: 'current'
artifactName: 'WSLDVCPlugin.x64.pdb'
targetPath: 'package/'
- task: DownloadPipelineArtifact@2
displayName: 'Download system_arm64.vhd'
inputs:
buildType: 'current'
artifactName: 'system_arm64.vhd'
targetPath: 'package/'
- task: DownloadPipelineArtifact@2
displayName: 'Download system_arm64.img'
inputs:
buildType: 'current'
artifactName: 'system_arm64.img'
targetPath: 'package/'
- task: DownloadPipelineArtifact@2
displayName: 'Download system-debuginfo_arm64.tar.gz'
inputs:
buildType: 'current'
artifactName: 'system-debuginfo_arm64.tar.gz'
targetPath: 'package/'
- task: DownloadPipelineArtifact@2
displayName: 'Download WSLDVCPlugin DLL (ARM64)'
inputs:
buildType: 'current'
artifactName: 'WSLDVCPlugin.ARM64.dll'
targetPath: 'package/'
- task: DownloadPipelineArtifact@2
displayName: 'Download WSLDVCPlugin PDB (ARM64)'
inputs:
buildType: 'current'
artifactName: 'WSLDVCPlugin.ARM64.pdb'
targetPath: 'package/'
- task: PowerShell@2
displayName: 'Update Microsoft.WSLg.nuspec version'
inputs:
targetType: filePath
filePath: .\devops\updateversion.ps1
arguments: .\Microsoft.WSLg.nuspec "package.metadata.version" "" "-beta"
pwsh: true
- task: PowerShell@2
displayName: 'Update Microsoft.WSLg.nuspec release notes'
inputs:
targetType: filePath
filePath: .\devops\updateversion.ps1
arguments: .\Microsoft.WSLg.nuspec "package.metadata.releaseNotes" "" "-beta" "hash"
pwsh: true
- script: 'nuget pack .\Microsoft.WSLg.nuspec'
displayName: 'Package NuGet'
- script: 'rename *.nupkg Microsoft.WSLg.nupkg'
displayName: 'Rename Nuget Package'
- task: PublishPipelineArtifact@1
displayName: 'Save Microsoft.WSLg.nupkg artifact'
inputs:
targetPath: Microsoft.WSLg.nupkg
artifact: 'Microsoft.WSLg.nupkg'
publishLocation: 'pipeline'
- task: '333b11bd-d341-40d9-afcf-b32d5ce6f23b@2'
condition: eq(variables['Build.SourceBranch'], 'refs/heads/main')
inputs:
command: 'push'
packagesToPush: 'Microsoft.WSLg.nupkg'
nuGetFeedType: 'internal'
publishVstsFeed: 'wsl'
allowPackageConflicts: true
verbosityPush: 'Normal'