-
Notifications
You must be signed in to change notification settings - Fork 129
/
azure-pipelines.yml
369 lines (311 loc) · 10.6 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
trigger:
- master
variables:
windowsDllName: "blingfiretokdll.dll"
osxDllName: "libblingfiretokdll.dylib"
linuxDllName: "libblingfiretokdll.so"
win_X64_Artifact: "DllForWinX64"
win_Arm64_Artifact: "DllForWinArm64"
osx_X64_Artifact: "DllForOsxX64"
osx_arm64_Artifact: "DllForOsxArm64"
linux_X64_Artifact: "DllForLinuxX64"
linux_Arm64_Artifact: "DllForLinuxArm64"
jobs:
- job: Build_Dll_For_Win_X64
pool:
vmImage: windows-latest
steps:
- task: UseDotNet@2
displayName: 'Use .NET Core SDK'
inputs:
packageType: 'sdk'
version: '6.x'
- task: CmdLine@2
displayName: Create release folder for win-x64
inputs:
script: |
mkdir Release
- task: CMake@1
displayName: 'CMake for win-x64'
inputs:
workingDirectory: 'Release'
cmakeArgs: '..'
- task: MSBuild@1
displayName: 'Build for win-x64'
inputs:
solution: 'Release/BLING_FIRE.sln'
configuration: 'Release'
- task: CmdLine@2
displayName: 'Validate dll for win-x64'
inputs:
script: |
cd .\nuget\test\
dotnet build .\BlingUtilsTest.csproj
cp ..\..\Release\Release\blingfiretokdll.dll .\bin\Debug\net6.0\
dotnet .\bin\Debug\net6.0\BlingUtilsTest.dll
- task: CopyFiles@2
displayName: 'Copy blingfiretokdll.dll to: $(Build.ArtifactStagingDirectory)'
inputs:
SourceFolder: 'Release/Release'
Contents: $(windowsDllName)
TargetFolder: '$(build.artifactstagingdirectory)/native'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: blingfiretokdll.dll'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/native'
ArtifactName: $(win_X64_Artifact)
- job: Build_Dll_For_Win_ARM64
pool:
vmImage: windows-latest
steps:
- task: UseDotNet@2
displayName: 'Use .NET Core SDK'
inputs:
packageType: 'sdk'
version: '6.x'
- task: CmdLine@2
displayName: Create release folder for win-arm64
inputs:
script: |
mkdir Release
- task: CMake@1
displayName: 'CMake for win-arm64'
inputs:
workingDirectory: 'Release'
cmakeArgs: '-A ARM64 ..'
- task: MSBuild@1
displayName: 'Build for win-arm64'
inputs:
solution: 'Release/BLING_FIRE.sln'
configuration: 'Release'
- task: CopyFiles@2
displayName: 'Copy blingFire Nuget package to: $(Build.ArtifactStagingDirectory)'
inputs:
SourceFolder: 'Release/Release'
Contents: $(windowsDllName)
TargetFolder: '$(build.artifactstagingdirectory)/native'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: blingfiretokdll.dll'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/native'
ArtifactName: $(win_ARM64_Artifact)
- job: Build_Dll_For_Osx_X64
pool:
vmImage: macOS-latest
steps:
- task: UseDotNet@2
displayName: 'Use .NET Core SDK'
inputs:
packageType: 'sdk'
version: '6.x'
- task: CmdLine@2
displayName: Create release folder
inputs:
script: |
mkdir Release
- task: CMake@1
displayName: 'CMake'
inputs:
workingDirectory: 'Release'
cmakeArgs: '..'
- task: CmdLine@2
displayName: build project
inputs:
script: |
cd ./Release
make
- task: CmdLine@2
displayName: 'Validate binaries for osx-x64'
inputs:
script: |
cd ./nuget/test/
dotnet build ./BlingUtilsTest.csproj
cp ../../Release/libblingfiretokdll.dylib ./bin/Debug/net6.0/
dotnet ./bin/Debug/net6.0/BlingUtilsTest.dll
- task: CopyFiles@2
displayName: 'Copy $(osxDllName) to: $(Build.ArtifactStagingDirectory)'
inputs:
SourceFolder: 'Release'
Contents: $(osxDllName)
TargetFolder: '$(build.artifactstagingdirectory)/native'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: $(osxDllName)'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/native'
ArtifactName: $(osx_X64_Artifact)
- job: Build_Dll_For_Osx_ARM64
pool:
vmImage: macOS-latest
steps:
- task: UseDotNet@2
displayName: 'Use .NET Core SDK'
inputs:
packageType: 'sdk'
version: '6.x'
- task: CmdLine@2
displayName: Create release folder
inputs:
script: |
mkdir Release
- task: CMake@1
displayName: 'CMake'
inputs:
workingDirectory: 'Release'
cmakeArgs: '-DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_BUILD_TYPE=Release ..'
- task: CmdLine@2
displayName: build project
inputs:
script: |
cd ./Release
make
- task: CopyFiles@2
displayName: 'Copy $(osxDllName) to: $(Build.ArtifactStagingDirectory)'
inputs:
SourceFolder: 'Release'
Contents: $(osxDllName)
TargetFolder: '$(build.artifactstagingdirectory)/native'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: $(osxDllName)'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/native'
ArtifactName: $(osx_arm64_Artifact)
- job: Build_Dll_For_Linux_X64
pool:
vmImage: ubuntu-latest
steps:
- task: UseDotNet@2
displayName: 'Use .NET Core SDK'
inputs:
packageType: 'sdk'
version: '6.x'
- task: CmdLine@2
displayName: Create release folder
inputs:
script: |
mkdir Release
- task: CMake@1
displayName: 'CMake'
inputs:
workingDirectory: 'Release'
cmakeArgs: '..'
- task: CmdLine@2
displayName: build project
inputs:
script: |
cd ./Release
make
- task: CmdLine@2
displayName: 'Validate binaries for linux-x64'
inputs:
script: |
cd ./nuget/test/
dotnet build ./BlingUtilsTest.csproj
cp ../../Release/libblingfiretokdll.so ./bin/Debug/net6.0/
dotnet ./bin/Debug/net6.0/BlingUtilsTest.dll
- task: CopyFiles@2
displayName: 'Copy $(linuxDllName) to: $(Build.ArtifactStagingDirectory)'
inputs:
SourceFolder: 'Release'
Contents: $(linuxDllName)
TargetFolder: '$(build.artifactstagingdirectory)/native'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: $(linuxDllName)'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/native'
ArtifactName: $(linux_X64_Artifact)
- job: Build_Dll_For_Linux_ARM64
pool:
vmImage: ubuntu-latest
steps:
- task: CmdLine@2
displayName: Create release folder
inputs:
script: |
mkdir Release
- task: CmdLine@2
displayName: Install cross-compile tools
inputs:
script: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu
sudo apt-get install -y g++-aarch64-linux-gnu
- task: CMake@1
displayName: 'CMake'
inputs:
workingDirectory: 'Release'
cmakeArgs: '-DCMAKE_TOOLCHAIN_FILE=../buildTools/linux-arm64-cross.cmake -DCMAKE_BUILD_TYPE=Release ..'
- task: CmdLine@2
displayName: build project
inputs:
script: |
cd ./Release
make
- task: CopyFiles@2
displayName: 'Copy $(linuxDllName) to: $(Build.ArtifactStagingDirectory)'
inputs:
SourceFolder: 'Release'
Contents: $(linuxDllName)
TargetFolder: '$(build.artifactstagingdirectory)/native'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: $(linuxDllName)'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/native'
ArtifactName: $(linux_Arm64_Artifact)
- job: buildNugetPackage
dependsOn:
- Build_Dll_For_Win_X64
- Build_Dll_For_Win_ARM64
- Build_Dll_For_Osx_X64
- Build_Dll_For_Osx_ARM64
- Build_Dll_For_Linux_X64
- Build_Dll_For_Linux_ARM64
condition: succeeded()
pool:
vmImage: windows-latest
steps:
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts for windows x64'
inputs:
artifactName: $(win_X64_Artifact)
downloadPath: 'nuget/lib/runtimes/win-x64/native'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts for windows arm64'
inputs:
artifactName: $(win_Arm64_Artifact)
downloadPath: 'nuget/lib/runtimes/win-arm64/native'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts for osx x64'
inputs:
artifactName: $(osx_X64_Artifact)
downloadPath: 'nuget/lib/runtimes/osx-x64/native'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts for osx arm64'
inputs:
artifactName: $(osx_Arm64_Artifact)
downloadPath: 'nuget/lib/runtimes/osx-arm64/native'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts for linux x64'
inputs:
artifactName: $(linux_X64_Artifact)
downloadPath: 'nuget/lib/runtimes/linux-x64/native'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts for linux Arm64'
inputs:
artifactName: $(linux_Arm64_Artifact)
downloadPath: 'nuget/lib/runtimes/linux-arm64/native'
- task: DotNetCoreCLI@2
inputs:
command: 'build'
projects: 'nuget/lib/BlingFireNuget.csproj'
arguments: '--configuration Release'
- task: CopyFiles@2
displayName: 'Copy blingFire Nuget package to: $(Build.ArtifactStagingDirectory)'
inputs:
SourceFolder: 'nuget/lib/bin/Release/'
Contents: '*.nupkg'
TargetFolder: '$(build.artifactstagingdirectory)\nupkg'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: nupkg'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)\nupkg'
ArtifactName: nupkg