forked from unoplatform/calculator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vsts-ci.Skia.yml
404 lines (331 loc) · 11.6 KB
/
.vsts-ci.Skia.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
jobs:
- job: Linux_Skia_CalcManager
container: unoplatform/dotnet-build:3.0.1
pool:
vmImage: 'ubuntu-20.04'
variables:
NUGET_PACKAGES: $(build.sourcesdirectory)/.nuget
VersionCodeOffset: 400559 # last value for the APK release
steps:
- checkout: self
clean: true
- template: build/uno-ci/canary-updater.yml
- script: |
cd src/CalcManager
chmod +x build_linux.sh
./build_linux.sh
displayName: 'Build CalcManager'
- task: PublishBuildArtifacts@1
displayName: Publish Package Artifacts
retryCountOnTaskFailure: 3
inputs:
pathToPublish: $(build.sourcesdirectory)/src/CalcManager/bin/runtimes
artifactType: container
artifactName: CalcManagerLibs
- job: Linux_Skia_x86
dependsOn: Linux_Skia_CalcManager
container: unoplatform/dotnet-build:3.0.1
pool:
vmImage: 'ubuntu-20.04'
variables:
NUGET_PACKAGES: $(build.sourcesdirectory)/.nuget
VersionCodeOffset: 400559 # last value for the APK release
workspace:
clean: all
steps:
- checkout: self
clean: true
- task: DownloadBuildArtifacts@0
inputs:
artifactName: CalcManagerLibs
downloadPath: '$(build.sourcesdirectory)/src/build'
- script: |
mkdir -p $(build.sourcesdirectory)/src/CalcManager/bin/runtimes
cp -rv $(build.sourcesdirectory)/src/build/CalcManagerLibs/* $(build.sourcesdirectory)/src/CalcManager/bin/runtimes
displayName: 'Copy CalcManager to final location'
- template: build/uno-ci/canary-updater.yml
- template: build/uno-ci/gitversion.yml
- task: UseDotNet@2
displayName: 'Use .Net Core runtime 6.0.400'
retryCountOnTaskFailure: 3
inputs:
version: 6.0.400
- task: MSBuild@1
displayName: 'Setup versions'
retryCountOnTaskFailure: 3
inputs:
solution: src/build/build.csproj
msbuildLocationMethod: version
msbuildVersion: latest
msbuildArchitecture: x86
msbuildArguments: /r /p:Configuration=Release /detailedsummary
clean: false
maximumCpuCount: true
restoreNugetPackages: false
logProjectEvents: false
createLogFile: false
- script: |
dotnet publish -c Release -r linux-x64 --self-contained true $(build.sourcesdirectory)/src/Calculator.Skia.Gtk/Calculator.Skia.Gtk.csproj
echo "$GITVERSION_FullSemVer" > $(build.sourcesdirectory)/src/Calculator.Skia.Gtk/bin/Release/net6.0/linux-x64/publish/VERSION
displayName: 'Build Skia linux-x64'
env:
GITVERSION_FullSemVer: $(GITVERSION.FullSemVer)
- script: mkdir -p $(Build.ArtifactStagingDirectory)/skia
displayName: 'Create artifacts folder'
- task: ArchiveFiles@2
displayName: 'Archive Skia linux-x64'
inputs:
rootFolderOrFile: '$(build.sourcesdirectory)/src/Calculator.Skia.Gtk/bin/Release/net6.0/linux-x64/publish/'
archiveFile: '$(Build.ArtifactStagingDirectory)/skia/Calculator-linux-x64.zip'
includeRootFolder: false
- task: PublishBuildArtifacts@1
displayName: Publish Package Artifacts
retryCountOnTaskFailure: 3
inputs:
pathToPublish: $(build.artifactstagingdirectory)
artifactType: container
artifactName: Calculator
- job: Linux_Skia_ARM
dependsOn: Linux_Skia_CalcManager
container: unoplatform/dotnet-build:3.0.1-arm64
pool: 'Linux-Arm64-20.04'
#container: unoplatform/dotnet-build:3.0.1
#pool:
# vmImage: 'ubuntu-20.04'
workspace:
clean: all
variables:
NUGET_PACKAGES: $(build.sourcesdirectory)/.nuget
VersionCodeOffset: 400559 # last value for the APK release
steps:
- checkout: self
clean: true
- template: build/uno-ci/canary-updater.yml
- task: gitversion/setup@0
retryCountOnTaskFailure: 3
inputs:
versionSpec: '5.x'
- task: gitversion/execute@0
inputs:
updateAssemblyInfo: 'False'
useConfigFile: true
configFilePath: gitversion.yml
displayName: Use GitVersion
- task: UseDotNet@2
displayName: 'Use .Net Core runtime 6.0.400'
retryCountOnTaskFailure: 3
inputs:
version: 6.0.400
- task: DownloadBuildArtifacts@0
inputs:
artifactName: CalcManagerLibs
downloadPath: '$(build.sourcesdirectory)/src/build'
- script: |
mkdir -p $(build.sourcesdirectory)/src/CalcManager/bin/runtimes
cp -rv $(build.sourcesdirectory)/src/build/CalcManagerLibs/* $(build.sourcesdirectory)/src/CalcManager/bin/runtimes
displayName: 'Copy CalcManager to final location'
- task: MSBuild@1
displayName: 'Setup versions'
retryCountOnTaskFailure: 3
inputs:
solution: src/build/build.csproj
msbuildLocationMethod: version
msbuildVersion: latest
msbuildArchitecture: x86
msbuildArguments: /r /p:Configuration=Release /detailedsummary
clean: false
maximumCpuCount: true
restoreNugetPackages: false
logProjectEvents: false
createLogFile: false
- script: |
dotnet publish -c Release -r linux-arm --self-contained true $(build.sourcesdirectory)/src/Calculator.Skia.Gtk/Calculator.Skia.Gtk.csproj
echo "$GITVERSION_FullSemVer" > $(build.sourcesdirectory)/src/Calculator.Skia.Gtk/bin/Release/net6.0/linux-arm/publish/VERSION
displayName: 'Build Skia linux-arm'
env:
GITVERSION_FullSemVer: $(GITVERSION.FullSemVer)
- script: |
dotnet publish -c Release -r linux-arm64 --self-contained true $(build.sourcesdirectory)/src/Calculator.Skia.Gtk/Calculator.Skia.Gtk.csproj
echo "$GITVERSION_FullSemVer" > $(build.sourcesdirectory)/src/Calculator.Skia.Gtk/bin/Release/net6.0/linux-arm64/publish/VERSION
displayName: 'Build Skia linux-arm64'
env:
GITVERSION_FullSemVer: $(GITVERSION.FullSemVer)
- script: mkdir -p $(Build.ArtifactStagingDirectory)/skia
displayName: 'Create artifacts folder'
- task: ArchiveFiles@2
displayName: 'Archive Skia linux-arm'
inputs:
rootFolderOrFile: '$(build.sourcesdirectory)/src/Calculator.Skia.Gtk/bin/Release/net6.0/linux-arm/publish/'
archiveFile: '$(Build.ArtifactStagingDirectory)/skia/Calculator-linux-arm.zip'
includeRootFolder: false
- task: ArchiveFiles@2
displayName: 'Archive Skia linux-arm64'
inputs:
rootFolderOrFile: '$(build.sourcesdirectory)/src/Calculator.Skia.Gtk/bin/Release/net6.0/linux-arm64/publish/'
archiveFile: '$(Build.ArtifactStagingDirectory)/skia/Calculator-linux-arm64.zip'
includeRootFolder: false
- task: PublishBuildArtifacts@1
displayName: Publish Package Artifacts
retryCountOnTaskFailure: 3
inputs:
pathToPublish: $(build.artifactstagingdirectory)
artifactType: container
artifactName: Calculator
- job: Linux_Snap
dependsOn:
- Linux_Skia_x86
pool:
vmImage: 'ubuntu-latest'
steps:
- task: DownloadBuildArtifacts@0
inputs:
artifactName: Calculator
downloadPath: '$(build.sourcesdirectory)/build'
- script: |
sudo snap install snapcraft --classic --channel stable
sudo usermod --append --groups lxd $USER
export PATH=$PATH:/snap/bin
sudo chown root:root /
sudo /snap/bin/lxd.migrate -yes
sudo /snap/bin/lxd waitready
sudo /snap/bin/lxd init --auto
displayName: 'Install Snapcraft'
retryCountOnTaskFailure: 3
- script: |
export PATH=$PATH:/snap/bin
cd $(build.sourcesdirectory)/build
sg lxd -c 'snapcraft --use-lxd'
displayName: 'Build Snap'
- task: CopyFiles@2
displayName: 'Publish Snap'
inputs:
SourceFolder: $(build.sourcesdirectory)/build
Contents: '**/*.snap'
TargetFolder: $(build.artifactstagingdirectory)/skia
CleanTargetFolder: false
OverWrite: false
flattenFolders: false
- task: PublishBuildArtifacts@1
displayName: Publish Package Artifacts
retryCountOnTaskFailure: 3
inputs:
pathToPublish: $(build.artifactstagingdirectory)
artifactType: container
artifactName: Calculator
- job: ARM64_Snap
dependsOn:
- Linux_Skia_ARM
container: unoplatform/snapcraft:20201014-arm64
pool: 'Linux-Arm64-20.04'
steps:
- task: DownloadBuildArtifacts@0
inputs:
artifactName: Calculator
downloadPath: '$(build.sourcesdirectory)/build'
- script: |
cd $(build.sourcesdirectory)/build
snapcraft
retryCountOnTaskFailure: 3
- task: CopyFiles@2
displayName: 'Publish Snap'
inputs:
SourceFolder: $(build.sourcesdirectory)/build
Contents: '**/*.snap'
TargetFolder: $(build.artifactstagingdirectory)/skia
CleanTargetFolder: false
OverWrite: false
flattenFolders: false
- task: PublishBuildArtifacts@1
displayName: Publish Package Artifacts
retryCountOnTaskFailure: 3
inputs:
pathToPublish: $(build.artifactstagingdirectory)
artifactType: container
artifactName: Calculator
# armhf is not supported by azuredevops
# - job: ARMHF_Snap
# dependsOn:
# - Linux_Skia_ARM
#
# container: unoplatform/snapcraft:20201014-armhf
# pool: 'Linux-Arm64-20.04'
#
# steps:
# - task: DownloadBuildArtifacts@0
# inputs:
# artifactName: Calculator
# downloadPath: '$(build.sourcesdirectory)/build'
#
# - script: |
# cd $(build.sourcesdirectory)/build
# snapcraft
#
# - task: CopyFiles@2
# displayName: 'Publish Snap'
# inputs:
# SourceFolder: $(build.sourcesdirectory)/build
# Contents: '**/*.snap'
# TargetFolder: $(build.artifactstagingdirectory)/skia
# CleanTargetFolder: false
# OverWrite: false
# flattenFolders: false
#
# - task: PublishBuildArtifacts@1
# displayName: Publish Package Artifacts
# inputs:
# pathToPublish: $(build.artifactstagingdirectory)
# artifactType: container
# artifactName: Calculator
- job: x64_AppImage
dependsOn:
- Linux_Skia_x86
pool:
vmImage: 'ubuntu-latest'
container:
image: appimagecrafters/appimage-builder:0.7.2
options: "--name ci-container -v /usr/bin/docker:/tmp/docker:ro"
steps:
- task: UseDotNet@2
displayName: 'Use .Net Core runtime 3.1.x'
retryCountOnTaskFailure: 3
inputs:
packageType: sdk
version: '3.1.x'
- task: gitversion/setup@0
retryCountOnTaskFailure: 3
inputs:
versionSpec: '5.x'
- task: gitversion/execute@0
inputs:
updateAssemblyInfo: 'False'
useConfigFile: true
configFilePath: gitversion.yml
displayName: Use GitVersion
- task: DownloadBuildArtifacts@0
inputs:
artifactName: Calculator
downloadPath: '$(build.sourcesdirectory)/build'
- script: |
/tmp/docker exec -t -u 0 ci-container \
sh -c "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confold" -y install sudo"
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata
sudo apt -y install zip
displayName: 'Setup dependencies'
retryCountOnTaskFailure: 3
- script: |
cd $(build.sourcesdirectory)/build/appimage
mkdir -p AppDir/usr/bin/uno-calculator
unzip $(build.sourcesdirectory)/build/Calculator/skia/Calculator-linux-x64.zip -d AppDir/usr/bin/uno-calculator
mkdir -p AppDir/usr/share/icons/50x50
cp AppDir/usr/bin/uno-calculator/Assets/StoreLogo.png AppDir/usr/share/icons/50x50/
appimage-builder --recipe AppImageBuilder.x64.yaml --skip-test
cp *.AppImage $(build.artifactstagingdirectory)
env:
GITVERSION_FullSemVer: $(GitVersion.FullSemVer)
- task: PublishBuildArtifacts@1
displayName: Publish Package Artifacts
retryCountOnTaskFailure: 3
inputs:
pathToPublish: $(build.artifactstagingdirectory)
artifactType: container
artifactName: Calculator