-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-pipelines.yml
528 lines (437 loc) · 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
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
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
trigger:
- master
- feature/*
- refs/tags/v*.*.*
variables:
AVSPLUS_VERSION: 3.6.1
AVSPLUS_FILESONLY_NAME: AviSynthPlus_3.6.1_20200619-filesonly
AVSPLUS_CACHE_FOLDER: $(Pipeline.Workspace)/.avsplus
resources:
repositories:
- repository: AviSynthPlus
type: github
endpoint: ItEndsWithTens
name: AviSynth/AviSynthPlus
ref: refs/tags/v$(AVSPLUS_VERSION)
jobs:
- job: Windows
displayName: "Windows"
pool:
vmImage: 'windows-latest'
steps:
- checkout: self
submodules: recursive
- task: Cache@2
inputs:
key: 'avsplus | "$(AVSPLUS_VERSION)" | "$(Agent.OS)"'
path: $(AVSPLUS_CACHE_FOLDER)
cacheHitVar: AVSPLUS_CACHE_RESTORED
- task: PowerShell@2
displayName: "Download AviSynth+ source archive"
condition: ne(variables.AVSPLUS_CACHE_RESTORED, 'true')
inputs:
targetType: 'inline'
script: |
New-Item -Path $(AVSPLUS_CACHE_FOLDER) -ItemType directory
$PreviousProgressPreference = $ProgressPreference
$ProgressPreference = "SilentlyContinue"
Invoke-WebRequest -Uri https://github.com/AviSynth/AviSynthPlus/archive/v$(AVSPLUS_VERSION).zip -OutFile $(AVSPLUS_CACHE_FOLDER)\v$(AVSPLUS_VERSION).zip
$ProgressPreference = $PreviousProgressPreference
- task: PowerShell@2
displayName: "Download AviSynth+ binary archive"
condition: ne(variables.AVSPLUS_CACHE_RESTORED, 'true')
inputs:
targetType: 'inline'
script: |
$PreviousProgressPreference = $ProgressPreference
$ProgressPreference = "SilentlyContinue"
Invoke-WebRequest -Uri https://github.com/AviSynth/AviSynthPlus/releases/download/v$(AVSPLUS_VERSION)/$(AVSPLUS_FILESONLY_NAME).7z -OutFile $(AVSPLUS_CACHE_FOLDER)\$(AVSPLUS_FILESONLY_NAME).7z
$ProgressPreference = $PreviousProgressPreference
- task: ExtractFiles@1
condition: ne(variables.AVSPLUS_CACHE_RESTORED, 'true')
displayName: "Extract AviSynth+ source"
inputs:
archiveFilePatterns: '$(AVSPLUS_CACHE_FOLDER)/*.zip'
destinationFolder: '$(AVSPLUS_CACHE_FOLDER)'
cleanDestinationFolder: false
- task: ExtractFiles@1
condition: ne(variables.AVSPLUS_CACHE_RESTORED, 'true')
displayName: "Extract AviSynth+ binaries"
inputs:
archiveFilePatterns: '$(AVSPLUS_CACHE_FOLDER)/*.7z'
destinationFolder: '$(AVSPLUS_CACHE_FOLDER)'
cleanDestinationFolder: false
- task: DeleteFiles@1
displayName: "Remove downloaded archives"
condition: ne(variables.AVSPLUS_CACHE_RESTORED, 'true')
inputs:
SourceFolder: '$(AVSPLUS_CACHE_FOLDER)'
Contents: |
v$(AVSPLUS_VERSION).zip
$(AVSPLUS_FILESONLY_NAME).7z
- task: CopyFiles@2
displayName: "Copy Avs headers into position"
inputs:
SourceFolder: '$(AVSPLUS_CACHE_FOLDER)/AviSynthPlus-$(AVSPLUS_VERSION)/avs_core/include'
Contents: '**'
TargetFolder: '$(Build.SourcesDirectory)/include/avs_plus/include'
- task: CMake@1
displayName: "Configure/generate x86"
inputs:
workingDirectory: '$(Build.SourcesDirectory)/build'
cmakeArgs: '.. -G "Visual Studio 16 2019" -A "Win32" -DAVISYNTHPLUS_HDR="$(Build.SourcesDirectory)/include/avs_plus/include/avisynth.h"'
- task: CMake@1
displayName: "Build/pack x86"
inputs:
workingDirectory: '$(Build.SourcesDirectory)/build'
cmakeArgs: '--build . --config Release --target PACKAGE'
- task: CopyFiles@2
displayName: "Prepare x86 Avisynth DLL"
inputs:
SourceFolder: '$(AVSPLUS_CACHE_FOLDER)/$(AVSPLUS_FILESONLY_NAME)/x86'
Contents: 'AviSynth.dll'
TargetFolder: '$(Build.SourcesDirectory)/artifacts/build/bin'
flattenFolders: true
- task: CopyFiles@2
displayName: "Prepare x86 DevIL DLL"
inputs:
SourceFolder: '$(AVSPLUS_CACHE_FOLDER)/$(AVSPLUS_FILESONLY_NAME)/x86/system'
Contents: 'DevIL.dll'
TargetFolder: '$(Build.SourcesDirectory)/artifacts/build/bin'
flattenFolders: true
- task: CopyFiles@2
displayName: "Prepare x86 core function plugins"
inputs:
SourceFolder: '$(AVSPLUS_CACHE_FOLDER)/$(AVSPLUS_FILESONLY_NAME)/x86/plugins'
Contents: '*.dll'
TargetFolder: '$(Build.SourcesDirectory)/artifacts/build/lib'
flattenFolders: true
- task: PowerShell@2
displayName: "Test x86"
inputs:
targetType: 'inline'
script: |
cd $(Build.SourcesDirectory)/artifacts/build/bin
$ArgList = '-r junit -o TEST-Windows-x86.xml'
$TurnsTileTestProcess = (Start-Process .\TurnsTile-test -ArgumentList $ArgList -NoNewWindow -PassThru -Wait)
if ($TurnsTileTestProcess.ExitCode -ne 0)
{
Write-Error "TurnsTile-test failed with exit code $($TurnsTileTestProcess.ExitCode)!"
}
- task: PublishTestResults@2
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '**/TEST-Windows-x86.xml'
searchFolder: '$(Build.SourcesDirectory)'
failTaskOnFailedTests: true
testRunTitle: 'Windows x86 tests'
buildPlatform: 'x86'
- task: DeleteFiles@1
displayName: "Remove generated project files"
inputs:
SourceFolder: '$(Build.SourcesDirectory)/build'
Contents: '**'
- task: DeleteFiles@1
displayName: "Remove x86 binaries"
inputs:
SourceFolder: '$(Build.SourcesDirectory)/artifacts/build'
Contents: '**'
- task: CMake@1
displayName: "Configure/generate x64"
inputs:
workingDirectory: '$(Build.SourcesDirectory)/build'
cmakeArgs: '.. -G "Visual Studio 16 2019" -A "x64" -DAVISYNTHPLUS_HDR="$(Build.SourcesDirectory)/include/avs_plus/include/avisynth.h"'
- task: CMake@1
displayName: "Build/pack x64"
inputs:
workingDirectory: '$(Build.SourcesDirectory)/build'
cmakeArgs: '--build . --config Release --target PACKAGE'
- task: CopyFiles@2
displayName: "Prepare x64 Avisynth DLL"
inputs:
SourceFolder: '$(AVSPLUS_CACHE_FOLDER)/$(AVSPLUS_FILESONLY_NAME)/x64'
Contents: 'AviSynth.dll'
TargetFolder: '$(Build.SourcesDirectory)/artifacts/build/bin'
flattenFolders: true
- task: CopyFiles@2
displayName: "Prepare x64 DevIL DLL"
inputs:
SourceFolder: '$(AVSPLUS_CACHE_FOLDER)/$(AVSPLUS_FILESONLY_NAME)/x64/system'
Contents: 'DevIL.dll'
TargetFolder: '$(Build.SourcesDirectory)/artifacts/build/bin'
flattenFolders: true
- task: CopyFiles@2
displayName: "Prepare x64 core function DLLs"
inputs:
SourceFolder: '$(AVSPLUS_CACHE_FOLDER)/$(AVSPLUS_FILESONLY_NAME)/x64/plugins'
Contents: '*.dll'
TargetFolder: '$(Build.SourcesDirectory)/artifacts/build/lib'
flattenFolders: true
- task: PowerShell@2
displayName: "Test x64"
inputs:
targetType: 'inline'
script: |
cd $(Build.SourcesDirectory)/artifacts/build/bin
$ArgList = '-r junit -o TEST-Windows-x64.xml'
$TurnsTileTestProcess = (Start-Process .\TurnsTile-test -ArgumentList $ArgList -NoNewWindow -PassThru -Wait)
if ($TurnsTileTestProcess.ExitCode -ne 0)
{
Write-Error "TurnsTile-test failed with exit code $($TurnsTileTestProcess.ExitCode)!"
}
- task: PublishTestResults@2
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '**/TEST-Windows-x64.xml'
searchFolder: '$(Build.SourcesDirectory)'
failTaskOnFailedTests: true
testRunTitle: 'Windows x64 tests'
buildPlatform: 'x64'
- task: PublishPipelineArtifact@1
displayName: "Publish packages"
inputs:
targetPath: '$(Build.SourcesDirectory)/artifacts/pack/'
artifact: 'TurnsTile Windows binaries'
publishLocation: 'pipeline'
- job: Mac
displayName: "Mac"
pool:
vmImage: 'macOS-latest'
steps:
- checkout: self
submodules: recursive
- task: Cache@2
inputs:
key: 'avsplus | "$(AVSPLUS_VERSION)" | "$(Agent.OS)"'
path: $(AVSPLUS_CACHE_FOLDER)
cacheHitVar: AVSPLUS_CACHE_RESTORED
- checkout: AviSynthPlus
displayName: 'Clone AviSynthPlus repo'
condition: ne(variables.AVSPLUS_CACHE_RESTORED, 'true')
- task: CopyFiles@2
displayName: "Cache AviSynth+ headers"
condition: ne(variables.AVSPLUS_CACHE_RESTORED, 'true')
inputs:
SourceFolder: '$(Build.SourcesDirectory)/AviSynthPlus/avs_core/include'
Contents: '**'
TargetFolder: '$(AVSPLUS_CACHE_FOLDER)/include'
- task: CopyFiles@2
displayName: "Copy Avs headers into position"
inputs:
SourceFolder: '$(AVSPLUS_CACHE_FOLDER)/include'
Contents: '**'
TargetFolder: '$(Build.SourcesDirectory)/TurnsTile/include/avs_plus/include'
- task: Bash@3
displayName: 'Install Ninja'
inputs:
targetType: 'inline'
script: brew install ninja
- task: CMake@1
displayName: "Configure/generate TurnsTile"
inputs:
workingDirectory: '$(Build.SourcesDirectory)/TurnsTile/build'
cmakeArgs: '.. -G Ninja -DAVISYNTHPLUS_HDR="$(Build.SourcesDirectory)/TurnsTile/include/avs_plus/include/avisynth.h"'
- task: CMake@1
displayName: "Build/pack TurnsTile"
inputs:
workingDirectory: '$(Build.SourcesDirectory)/TurnsTile/build'
cmakeArgs: '--build . --config Release --target package'
- task: Bash@3
displayName: 'Build AviSynthPlus'
condition: ne(variables.AVSPLUS_CACHE_RESTORED, 'true')
inputs:
targetType: 'inline'
script: |
cd $(Build.SourcesDirectory)/AviSynthPlus
mkdir avisynth-build
cd avisynth-build
cmake ../ -G Ninja
ninja
- task: CopyFiles@2
displayName: "Cache AviSynth+ libs"
condition: ne(variables.AVSPLUS_CACHE_RESTORED, 'true')
inputs:
SourceFolder: '$(Build.SourcesDirectory)/AviSynthPlus/avisynth-build/avs_core'
Contents: '*.dylib'
TargetFolder: '$(AVSPLUS_CACHE_FOLDER)/lib'
- task: CopyFiles@2
displayName: "Cache AviSynth+ core function plugins"
condition: ne(variables.AVSPLUS_CACHE_RESTORED, 'true')
inputs:
SourceFolder: '$(Build.SourcesDirectory)/AviSynthPlus/avisynth-build/plugins'
Contents: '**/*.dylib'
TargetFolder: '$(AVSPLUS_CACHE_FOLDER)/plugins'
flattenFolders: true
- task: CopyFiles@2
displayName: "Prepare Avisynth+ libs"
inputs:
SourceFolder: '$(AVSPLUS_CACHE_FOLDER)/lib'
Contents: '*.dylib'
TargetFolder: '$(Build.SourcesDirectory)/TurnsTile/artifacts/build/bin'
- task: CopyFiles@2
displayName: "Prepare Avisynth+ core function plugins"
inputs:
SourceFolder: '$(AVSPLUS_CACHE_FOLDER)/plugins'
Contents: '*.dylib'
TargetFolder: '$(Build.SourcesDirectory)/TurnsTile/artifacts/build/lib'
- task: Bash@3
displayName: 'Test'
inputs:
targetType: 'inline'
script: |
cd $(Build.SourcesDirectory)/TurnsTile/artifacts/build/bin
./turnstile-test -r junit -o TEST-Mac.xml
- task: PublishTestResults@2
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '**/TEST-Mac.xml'
searchFolder: '$(Build.SourcesDirectory)/TurnsTile'
failTaskOnFailedTests: true
testRunTitle: 'Mac tests'
- task: PublishPipelineArtifact@1
displayName: "Publish packages"
inputs:
targetPath: '$(Build.SourcesDirectory)/TurnsTile/artifacts/pack/'
artifact: 'TurnsTile macOS binaries'
publishLocation: 'pipeline'
- job: Linux
displayName: "Linux"
pool:
vmImage: 'ubuntu-latest'
variables:
CC: gcc-9
CXX: g++-9
LD: gcc-9
# Contrary to macOS, dlopen in Linux doesn't search the executable directory
# for libraries it's trying to load. This environment variable fixes that.
LD_LIBRARY_PATH: $(Build.SourcesDirectory)/TurnsTile/artifacts/build/bin
steps:
- checkout: self
submodules: recursive
- task: Cache@2
inputs:
key: 'avsplus | "$(AVSPLUS_VERSION)" | "$(Agent.OS)"'
path: $(AVSPLUS_CACHE_FOLDER)
cacheHitVar: AVSPLUS_CACHE_RESTORED
- checkout: AviSynthPlus
displayName: 'Clone AviSynthPlus repo'
condition: ne(variables.AVSPLUS_CACHE_RESTORED, 'true')
- task: CopyFiles@2
displayName: "Cache AviSynth+ headers"
condition: ne(variables.AVSPLUS_CACHE_RESTORED, 'true')
inputs:
SourceFolder: '$(Build.SourcesDirectory)/AviSynthPlus/avs_core/include'
Contents: '**'
TargetFolder: '$(AVSPLUS_CACHE_FOLDER)/include'
- task: CopyFiles@2
displayName: "Copy Avs headers into position"
inputs:
SourceFolder: '$(AVSPLUS_CACHE_FOLDER)/include'
Contents: '**'
TargetFolder: '$(Build.SourcesDirectory)/TurnsTile/include/avs_plus/include'
- task: Bash@3
displayName: 'Install Ninja'
inputs:
targetType: 'inline'
script: brew install ninja
- task: CMake@1
displayName: "Configure/generate TurnsTile"
inputs:
workingDirectory: '$(Build.SourcesDirectory)/TurnsTile/build'
cmakeArgs: '.. -G Ninja -DAVISYNTHPLUS_HDR="$(Build.SourcesDirectory)/TurnsTile/include/avs_plus/include/avisynth.h"'
- task: CMake@1
displayName: "Build/pack TurnsTile"
inputs:
workingDirectory: '$(Build.SourcesDirectory)/TurnsTile/build'
cmakeArgs: '--build . --config Release --target package'
- task: Bash@3
displayName: 'Build AviSynthPlus'
condition: ne(variables.AVSPLUS_CACHE_RESTORED, 'true')
inputs:
targetType: 'inline'
script: |
cd $(Build.SourcesDirectory)/AviSynthPlus
mkdir avisynth-build
cd avisynth-build
cmake ../ -G Ninja
ninja
- task: CopyFiles@2
displayName: "Cache AviSynth+ libs"
condition: ne(variables.AVSPLUS_CACHE_RESTORED, 'true')
inputs:
SourceFolder: '$(Build.SourcesDirectory)/AviSynthPlus/avisynth-build/avs_core'
Contents: '*.so*'
TargetFolder: '$(AVSPLUS_CACHE_FOLDER)/lib'
- task: CopyFiles@2
displayName: "Cache AviSynth+ core function plugins"
condition: ne(variables.AVSPLUS_CACHE_RESTORED, 'true')
inputs:
SourceFolder: '$(Build.SourcesDirectory)/AviSynthPlus/avisynth-build/plugins'
Contents: '**/*.so'
TargetFolder: '$(AVSPLUS_CACHE_FOLDER)/plugins'
flattenFolders: true
- task: CopyFiles@2
displayName: "Prepare Avisynth+ libs"
inputs:
SourceFolder: '$(AVSPLUS_CACHE_FOLDER)/lib'
Contents: '*.so*'
TargetFolder: '$(Build.SourcesDirectory)/TurnsTile/artifacts/build/bin'
- task: CopyFiles@2
displayName: "Prepare Avisynth+ core function plugins"
inputs:
SourceFolder: '$(AVSPLUS_CACHE_FOLDER)/plugins'
Contents: '*.so'
TargetFolder: '$(Build.SourcesDirectory)/TurnsTile/artifacts/build/lib'
- task: Bash@3
displayName: 'Test'
inputs:
targetType: 'inline'
script: |
cd $(Build.SourcesDirectory)/TurnsTile/artifacts/build/bin
./turnstile-test -r junit -o TEST-Linux.xml
- task: PublishTestResults@2
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '**/TEST-Linux.xml'
searchFolder: '$(Build.SourcesDirectory)/TurnsTile'
failTaskOnFailedTests: true
testRunTitle: 'Linux tests'
- task: PublishPipelineArtifact@1
displayName: "Publish packages"
inputs:
targetPath: '$(Build.SourcesDirectory)/TurnsTile/artifacts/pack/'
artifact: 'TurnsTile Linux binaries'
publishLocation: 'pipeline'
- deployment:
displayName: "Create GitHub release"
condition: startsWith(variables['build.sourceBranch'], 'refs/tags/v')
dependsOn:
- Windows
- Mac
- Linux
environment: 'GitHubReleases'
pool:
vmImage: 'ubuntu-latest'
strategy:
runOnce:
deploy:
steps:
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
targetPath: '$(Pipeline.Workspace)'
- task: GitHubRelease@1
inputs:
gitHubConnection: 'GitHub release creation'
repositoryName: 'ItEndsWithTens/TurnsTile'
action: 'create'
target: '$(Build.SourceVersion)'
tagSource: 'gitTag'
tagPattern: 'v*.*.*'
assets: |
$(Pipeline.Workspace)/**/*.zip
$(Pipeline.Workspace)/**/*.gz
releaseNotesSource: 'inline'
isDraft: true
isPreRelease: false
addChangeLog: false