forked from microsoft/wslg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
317 lines (264 loc) · 10.3 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
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'
- 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'
- 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'
- task: PublishPipelineArtifact@1
displayName: 'Publish WSLDVCPlugin pdb (x64)'
inputs:
targetPath: WSLDVCPlugin\x64\Release\WSLDVCPlugin.pdb
artifact: 'WSLDVCPlugin.x64.pdb'
publishLocation: 'pipeline'
- script: 'MOVE WSLDVCPlugin\x64\Release\WSLDVCPlugin.dll package\WSLDVCPlugin_x64.dll'
displayName: 'Move plugin 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'
- 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'
- task: PublishPipelineArtifact@1
displayName: 'Publish WSLDVCPlugin pdb (ARM64)'
inputs:
targetPath: WSLDVCPlugin\ARM64\Release\WSLDVCPlugin.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 WSLDVCPlugin DLL (x64)'
inputs:
buildType: 'current'
artifactName: 'WSLDVCPlugin.x64.dll'
targetPath: 'package/'
- task: DownloadPipelineArtifact@2
displayName: 'Download system_arm64.vhd'
inputs:
buildType: 'current'
artifactName: 'system_arm64.vhd'
targetPath: 'package/'
- task: DownloadPipelineArtifact@2
displayName: 'Download WSLDVCPlugin DLL (ARM64)'
inputs:
buildType: 'current'
artifactName: 'WSLDVCPlugin.ARM64.dll'
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'