-
Notifications
You must be signed in to change notification settings - Fork 16
/
azure-pipelines.yml
267 lines (234 loc) · 7.64 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
# ASP.NET Core
# Build and test ASP.NET Core projects targeting .NET Core.
# Add steps that run tests, create a NuGet package, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
trigger:
- master
- development
pr:
- master
- development
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
jobs:
- job: 'windows_cpp_build'
pool:
vmImage: 'windows-2022'
steps:
- task: VSBuild@1
displayName: 'x86 build'
inputs:
solution: '**\*.vcxproj'
msbuildArgs: '/p:PostBuildEventUseInBuild=false'
platform: 'x86'
configuration: 'release'
- task: CopyFiles@2
displayName: 'Copy x86 NetModuleWrapper.dll'
inputs:
SourceFolder: 'NetModuleWrapper\release'
Contents: '**'
TargetFolder: '$(Build.ArtifactStagingDirectory)\x86'
- task: VSBuild@1
displayName: 'x64 build'
inputs:
solution: '**\*.vcxproj'
msbuildArgs: '/p:PostBuildEventUseInBuild=false'
platform: 'x64'
configuration: 'release'
- task: CopyFiles@2
displayName: 'Copy x64 NetModuleWrapper.dll'
inputs:
SourceFolder: 'NetModuleWrapper\x64\release'
Contents: '**'
TargetFolder: '$(Build.ArtifactStagingDirectory)\x64'
- task: PublishBuildArtifacts@1
displayName: 'publish artifacts to cpp_windows'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'cpp_windows'
publishLocation: 'Container'
- job: 'linux_cpp_build'
pool:
vmImage: 'ubuntu-latest'
steps:
- task: Bash@3
displayName: 'Compile x86 / x64'
inputs:
filePath: 'NetModuleWrapper/compile-x86.sh'
workingDirectory: 'NetModuleWrapper'
- task: Bash@3
displayName: 'Compile ARM'
inputs:
filePath: 'NetModuleWrapper/compile-arm.sh'
workingDirectory: 'NetModuleWrapper'
- task: CopyFiles@2
displayName: 'Copy x86 NetModuleWrapper.so'
inputs:
SourceFolder: 'NetModuleWrapper/x86'
Contents: 'NetModuleWrapper.so'
TargetFolder: '$(Build.ArtifactStagingDirectory)/x86'
- task: CopyFiles@2
displayName: 'Copy x64 NetModuleWrapper.so'
inputs:
SourceFolder: 'NetModuleWrapper/x64'
Contents: 'NetModuleWrapper.so'
TargetFolder: '$(Build.ArtifactStagingDirectory)/x64'
- task: CopyFiles@2
displayName: 'Copy arm32 NetModuleWrapper.so'
inputs:
SourceFolder: 'NetModuleWrapper/arm32'
Contents: 'NetModuleWrapper.so'
TargetFolder: '$(Build.ArtifactStagingDirectory)/arm32'
- task: CopyFiles@2
displayName: 'Copy arm64 NetModuleWrapper.so'
inputs:
SourceFolder: 'NetModuleWrapper/arm64'
Contents: 'NetModuleWrapper.so'
TargetFolder: '$(Build.ArtifactStagingDirectory)/arm64'
- task: PublishBuildArtifacts@1
displayName: 'publish artifacts to cpp_linux'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'cpp_linux'
publishLocation: 'Container'
- job: 'docfx_build'
continueOnError: true
pool:
vmImage: 'windows-2022'
steps:
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: '8.x'
- task: DotNetCoreCLI@2
displayName: 'Install docfx'
inputs:
command: 'custom'
custom: 'tool'
arguments: 'update -g docfx'
- task: DotNetCoreCLI@2
displayName: 'dotnet restore'
inputs:
command: 'restore'
feedsToUse: 'select'
- task: CmdLine@2
displayName: 'docfx build'
inputs:
script: 'docfx SlipeServer.Docs/docfx.json'
- task: CopyFiles@2
displayName: 'Copy DocFx output'
inputs:
SourceFolder: 'SlipeServer.Docs/_site'
Contents: '**'
TargetFolder: '$(System.ArtifactsDirectory)/docs'
OverWrite: true
- task: PublishBuildArtifacts@1
displayName: 'publish artifacts'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'docs'
publishLocation: 'Container'
- job: 'dotnet_build'
pool:
vmImage: 'windows-2022'
dependsOn:
- 'windows_cpp_build'
- 'linux_cpp_build'
steps:
- task: DownloadBuildArtifacts@1
displayName: 'Download linux cpp'
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'cpp_linux'
downloadPath: '$(System.ArtifactsDirectory)/netmodulewrapper/linux'
- task: CopyFiles@2
displayName: 'Copy x86 NetModuleWrapper.so'
inputs:
SourceFolder: '$(System.ArtifactsDirectory)/netmodulewrapper/linux/cpp_linux/x86'
Contents: 'NetModuleWrapper.so'
TargetFolder: 'SlipeServer.Net/Binaries/x86'
OverWrite: true
- task: CopyFiles@2
displayName: 'Copy x64 NetModuleWrapper.so'
inputs:
SourceFolder: '$(System.ArtifactsDirectory)/netmodulewrapper/linux/cpp_linux/x64'
Contents: 'NetModuleWrapper.so'
TargetFolder: 'SlipeServer.Net/Binaries/x64'
OverWrite: true
- task: CopyFiles@2
displayName: 'Copy arm32 NetModuleWrapper.so'
inputs:
SourceFolder: '$(System.ArtifactsDirectory)/netmodulewrapper/linux/cpp_linux/arm32'
Contents: 'NetModuleWrapper.so'
TargetFolder: 'SlipeServer.Net/Binaries/arm32'
OverWrite: true
- task: CopyFiles@2
displayName: 'Copy arm64 NetModuleWrapper.so'
inputs:
SourceFolder: '$(System.ArtifactsDirectory)/netmodulewrapper/linux/cpp_linux/arm64'
Contents: 'NetModuleWrapper.so'
TargetFolder: 'SlipeServer.Net/Binaries/arm64'
OverWrite: true
- task: DownloadBuildArtifacts@1
displayName: 'Download windows cpp'
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'cpp_windows'
downloadPath: '$(System.ArtifactsDirectory)/netmodulewrapper/windows'
- task: CopyFiles@2
displayName: 'Copy x86 NetModuleWrapper.dll'
inputs:
SourceFolder: '$(System.ArtifactsDirectory)/netmodulewrapper/windows/cpp_windows/x86'
Contents: 'NetModuleWrapper.dll'
TargetFolder: 'SlipeServer.Net/Binaries/x86'
OverWrite: true
- task: CopyFiles@2
displayName: 'Copy x64 NetModuleWrapper.dll'
inputs:
SourceFolder: '$(System.ArtifactsDirectory)/netmodulewrapper/windows/cpp_windows/x64'
Contents: 'NetModuleWrapper.dll'
TargetFolder: 'SlipeServer.Net/Binaries/x64'
OverWrite: true
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: '8.x'
- task: DotNetCoreCLI@2
displayName: 'dotnet restore'
inputs:
command: 'restore'
feedsToUse: 'select'
- task: DotNetCoreCLI@2
displayName: 'dotnet build'
inputs:
command: 'build'
- task: DotNetCoreCLI@2
displayName: 'dotnet test'
inputs:
command: 'test'
- task: DotNetCoreCLI@2
displayName: 'dotnet pack'
inputs:
command: 'pack'
packagesToPack: '**/SlipeServer.Packets.csproj;**/SlipeServer.Net.csproj;**/SlipeServer.Server.csproj;**/SlipeServer.Server.TestTools.csproj;**/SlipeServer.Scripting.csproj;**/SlipeServer.Lua.csproj;**/SlipeServer.Physics.csproj;**/SlipeServer.SourceGenerators.csproj;**/SlipeServer.LuaControllers.csproj;**/SlipeServer.Hosting.csproj'
versioningScheme: 'byPrereleaseNumber'
majorVersion: '0'
minorVersion: '1'
patchVersion: '0'
- task: DotNetCoreCLI@2
displayName: 'dotnet publish'
inputs:
command: 'publish'
publishWebProjects: false
projects: '**/*.sln'
arguments: '--output $(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
displayName: 'publish artifacts'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'