-
Notifications
You must be signed in to change notification settings - Fork 13
/
_appveyor.yml
358 lines (305 loc) · 15.7 KB
/
_appveyor.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
# master build but not delyor
-
version: '7.7.0.{build}'
os: Visual Studio 2022
configuration: Release
platform:
- x64
branches:
only:
- master
environment:
MyProjectDir: C:\projects\cvAutoTrack\
OpenCvDir: C:\projects\opencv\
OpenCvUrl: https://github.com/GengGode/OpencvStaticLib/releases/download/4.6.0/Opencv.zip
ProjectName: cvAutoTrack
ProJectExeName: cvAutoTrack
APPVEYOR_RDP_PASSWORD: A1B2C3D4##
skip_tags: true
install:
- ps: $env:TIME_STRING=(get-date -UFormat "%Y%m%d%a").ToString()
- echo %APPVEYOR_BUILD_VERSION%>>%MyProjectDir%cvAutoTrack\src\version\appVeyor_version_tag.tag
- cd %MyProjectDir%
- ps: ./ci/install_opencv.ps1
#- ps: ./ci/clone_resource.ps1
before_build:
- git submodule update --init --recursive
- ps: ./ci/release_resource.ps1
build_script:
# 编译器先开启远程桌面检查
- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
- MSBuild %MyProjectDir%cvAutoTrack\cvAutoTrack.vcxproj /p:configuration="Compile"
# 编译测试文件
- MSBuild %MyProjectDir%impl\Cpp\TEST_cvAutoTrack_Cpp\TEST_cvAutoTrack_Cpp.vcxproj /p:configuration="Compile"
- MSBuild %MyProjectDir%impl\CSharp\TEST_cvAutoTrack_CSharp\TEST_cvAutoTrack_CSharp.csproj /t:restore
- MSBuild %MyProjectDir%impl\CSharp\TEST_cvAutoTrack_CSharp\TEST_cvAutoTrack_CSharp.csproj /p:configuration="Compile"
after_build:
- echo %MyProjectDir%cvAutoTrack.sln 编译完成 等待测试
- mkdir %MyProjectDir%x64\build\
- ps: cp -r $env:MyProjectDir\cvAutoTrack\x64\Compile\*.dll $env:MyProjectDir\x64\build\
- ps: cp -r $env:MyProjectDir\cvAutoTrack\x64\Compile\*.lib $env:MyProjectDir\x64\build\
- ps: cp -r $env:MyProjectDir\cvAutoTrack\include\*.h $env:MyProjectDir\x64\build\
- ps: cp -r $env:MyProjectDir\impl\CSharp\TEST_cvAutoTrack_CSharp\cvAutoTrackCSharp.cs $env:MyProjectDir\x64\build\
# 从文件中读取 $version_tag.tag 设置 AppVeyor 版本
- ps: $env:APPVEYOR_BUILD_VERSION=$(Get-Content -Path $env:MyProjectDir\cvAutoTrack\src\version\version_tag.tag)
- ps: echo $env:APPVEYOR_BUILD_VERSION
before_test:
# 移动测试文件到test目录
- mkdir %MyProjectDir%x64\test\
- cd %MyProjectDir%
- ls -R
- ps: cp -r $env:MyProjectDir\cvAutoTrack\x64\Compile\*.dll $env:MyProjectDir\x64\test\
- ps: cp -r $env:MyProjectDir\impl\Cpp\TEST_cvAutoTrack_Cpp\x64\Compile\*.exe $env:MyProjectDir\x64\test\
- ps: cp -r $env:MyProjectDir\impl\CSharp\TEST_cvAutoTrack_CSharp\bin\x64\Compile\net6.0\*.exe $env:MyProjectDir\x64\test\
- ps: cp -r $env:MyProjectDir\impl\CSharp\TEST_cvAutoTrack_CSharp\bin\x64\Compile\net6.0\*.dll $env:MyProjectDir\x64\test\
- ps: cp -r $env:MyProjectDir\impl\CSharp\TEST_cvAutoTrack_CSharp\bin\x64\Compile\net6.0\*.json $env:MyProjectDir\x64\test\
test_script:
- cd %MyProjectDir%\x64\test\
- dir
# 运行 C++ 测试
- TEST_cvAutoTrack_Cpp.exe -test
# 运行 C# 测试
- TEST_cvAutoTrack_CSharp.exe -test
after_test:
- cd %MyProjectDir%x64\build\
- echo %APPVEYOR_BUILD_VERSION% >version.tag
- md5sum -b %MyProjectDir%x64\build\%ProjectName%.dll | cut -c 2-34 >%ProjectName%.md5
- 7z a cvautotrack.7z %MyProjectDir%x64\build\*
- ps: cp -r $env:MyProjectDir\impl\Cpp\TEST_cvAutoTrack_Cpp\x64\Compile\TEST_cvAutoTrack_Cpp.exe $env:MyProjectDir\x64\build\
-
- appveyor PushArtifact version.tag
- appveyor PushArtifact %ProjectName%.md5
- appveyor PushArtifact cvAutoTrack.7z
- appveyor PushArtifact TEST_cvAutoTrack_Cpp.exe
#artifacts:
#- path: build/Release
#artifacts path name must be appveyor API
deploy:
- provider: GitHub
description: '$(APPVEYOR_PROJECT_SLUG): cvAutoTrack Dll $(APPVEYOR_BUILD_VERSION).$(APPVEYOR_BUILD_NUMBER)'
auth_token:
secure: G/Fzf0bGIhqqt+XvsC5AXrZVNs3atGU7XCzJxqiUZEwOxoZrjxk87ENI/OitnXCo
draft: false
tag: $(APPVEYOR_BUILD_VERSION)
force_update: true
on:
APPVEYOR_REPO_TAG: false
notifications:
- provider: Email
to:
subject: '{{status}}: {{projectName}} {{buildVersion}}' # optional
message: "<h1>Build</h1>
<h2>{{projectName}} {{status}}</h2>
<p>{{buildVersion}}: {{buildUrl}}</p>
<H1>Commit</h1>
<h3>#{{commitId}} by {{commitAuthor}} on {{commitDate}}</h3><h2> {{commitMessage}}</h2>" # optional
on_build_success: true
on_build_failure: false
on_build_status_changed: false
-
version: '7.0.0.{build}'
os: Visual Studio 2022
configuration: Dev
platform:
- x64
branches:
only:
- /dev-/
- dev
environment:
MyProjectDir: C:\projects\cvAutoTrack\
OpenCvDir: C:\projects\opencv\
OpenCvUrl: https://github.com/GengGode/OpencvStaticLib/releases/download/4.6.0/Opencv.zip
ProjectName: cvAutoTrack
ProJectExeName: cvAutoTrack
skip_tags: true
install:
- ps: $env:TIME_STRING=(get-date -UFormat "%Y%m%d%a").ToString()
# 发布版本号为 APPVEYOR_BUILD_VERSION 去除 {build}
- ps: $env:APPVEYOR_BUILD_VERSION=$env:APPVEYOR_BUILD_VERSION.split('.')[0..2] -join '.'
# 显示运行名称和版本号
- ps: echo %APPVEYOR_BUILD_VERSION%
- ps: echo %APPVEYOR_BUILD_WORKER_IMAGE%
- cd %MyProjectDir%
- ps: ./ci/install_opencv.ps1
#- ps: ./ci/clone_resource.ps1
before_build:
- git submodule update --init --recursive
- ps: ./ci/release_resource.ps1
build_script:
- MSBuild %MyProjectDir%cvAutoTrack\cvAutoTrack.vcxproj /p:configuration="Compile"
# 编译测试文件
- MSBuild %MyProjectDir%impl\Cpp\TEST_cvAutoTrack_Cpp\TEST_cvAutoTrack_Cpp.vcxproj /p:configuration="Compile"
- MSBuild %MyProjectDir%impl\CSharp\TEST_cvAutoTrack_CSharp\TEST_cvAutoTrack_CSharp.csproj /t:restore
- MSBuild %MyProjectDir%impl\CSharp\TEST_cvAutoTrack_CSharp\TEST_cvAutoTrack_CSharp.csproj /p:configuration="Compile"
after_build:
- echo %MyProjectDir%cvAutoTrack.sln 编译完成 等待测试
- mkdir %MyProjectDir%x64\build\
- ps: cp -r $env:MyProjectDir\cvAutoTrack\x64\Compile\*.dll $env:MyProjectDir\x64\build\
- ps: cp -r $env:MyProjectDir\cvAutoTrack\x64\Compile\*.lib $env:MyProjectDir\x64\build\
- ps: cp -r $env:MyProjectDir\cvAutoTrack\include\*.h $env:MyProjectDir\x64\build\
- ps: cp -r $env:MyProjectDir\impl\CSharp\TEST_cvAutoTrack_CSharp\cvAutoTrackCSharp.cs $env:MyProjectDir\x64\build\
# 从文件中读取 $version_tag.tag 设置 AppVeyor 版本
#- $env:APPVEYOR_BUILD_VERSION = Get-Content -Path $env:MyProjectDir\cvAutoTrack\src\version\version_tag.tag
before_test:
# 移动测试文件到test目录
- mkdir %MyProjectDir%x64\test\
- cd %MyProjectDir%
- ls -R
- ps: cp -r $env:MyProjectDir\cvAutoTrack\x64\Compile\*.dll $env:MyProjectDir\x64\test\
- ps: cp -r $env:MyProjectDir\impl\Cpp\TEST_cvAutoTrack_Cpp\x64\Compile\*.exe $env:MyProjectDir\x64\test\
- ps: cp -r $env:MyProjectDir\impl\CSharp\TEST_cvAutoTrack_CSharp\bin\x64\Compile\net6.0\*.exe $env:MyProjectDir\x64\test\
- ps: cp -r $env:MyProjectDir\impl\CSharp\TEST_cvAutoTrack_CSharp\bin\x64\Compile\net6.0\*.dll $env:MyProjectDir\x64\test\
- ps: cp -r $env:MyProjectDir\impl\CSharp\TEST_cvAutoTrack_CSharp\bin\x64\Compile\net6.0\*.json $env:MyProjectDir\x64\test\
test_script:
- cd %MyProjectDir%\x64\test\
- dir
# 运行 C++ 测试
- TEST_cvAutoTrack_Cpp.exe -test
# 运行 C# 测试
- TEST_cvAutoTrack_CSharp.exe -test
after_test:
- cd %MyProjectDir%x64\build\
- echo %APPVEYOR_BUILD_VERSION% >version.tag
- md5sum -b %MyProjectDir%x64\build\%ProjectName%.dll | cut -c 2-34 >%ProjectName%.md5
- 7z a cvautotrack.7z %MyProjectDir%x64\build\*
- ps: cp -r $env:MyProjectDir\impl\Cpp\TEST_cvAutoTrack_Cpp\x64\Compile\TEST_cvAutoTrack_Cpp.exe $env:MyProjectDir\x64\build\
- appveyor PushArtifact version.tag
- appveyor PushArtifact %ProjectName%.md5
- appveyor PushArtifact cvAutoTrack.7z
- appveyor PushArtifact TEST_cvAutoTrack_Cpp.exe
-
version: '7.0.0.{build}'
os: Visual Studio 2022
configuration: Fix
platform:
- x64
branches:
only:
- /fix-/
environment:
MyProjectDir: C:\projects\cvAutoTrack\
OpenCvDir: C:\projects\opencv\
OpenCvUrl: https://github.com/GengGode/OpencvStaticLib/releases/download/4.6.0/Opencv.zip
ProjectName: cvAutoTrack
ProJectExeName: cvAutoTrack
skip_tags: true
install:
- ps: $env:TIME_STRING=(get-date -UFormat "%Y%m%d%a").ToString()
- cd %MyProjectDir%
- ps: ./ci/install_opencv.ps1
#- ps: ./ci/clone_resource.ps1
before_build:
- git submodule update --init --recursive
- ps: ./ci/release_resource.ps1
build_script:
- MSBuild %MyProjectDir%cvAutoTrack\cvAutoTrack.vcxproj /p:configuration="Compile"
# 编译测试文件
- MSBuild %MyProjectDir%impl\Cpp\TEST_cvAutoTrack_Cpp\TEST_cvAutoTrack_Cpp.vcxproj /p:configuration="Compile"
- MSBuild %MyProjectDir%impl\CSharp\TEST_cvAutoTrack_CSharp\TEST_cvAutoTrack_CSharp.csproj /t:restore
- MSBuild %MyProjectDir%impl\CSharp\TEST_cvAutoTrack_CSharp\TEST_cvAutoTrack_CSharp.csproj /p:configuration="Compile"
after_build:
- echo %MyProjectDir%cvAutoTrack.sln 编译完成 等待测试
- mkdir %MyProjectDir%x64\build\
- ps: cp -r $env:MyProjectDir\cvAutoTrack\x64\Compile\*.dll $env:MyProjectDir\x64\build\
- ps: cp -r $env:MyProjectDir\cvAutoTrack\x64\Compile\*.lib $env:MyProjectDir\x64\build\
- ps: cp -r $env:MyProjectDir\cvAutoTrack\include\*.h $env:MyProjectDir\x64\build\
- ps: cp -r $env:MyProjectDir\impl\CSharp\TEST_cvAutoTrack_CSharp\cvAutoTrackCSharp.cs $env:MyProjectDir\x64\build\
before_test:
# 移动测试文件到test目录
- mkdir %MyProjectDir%x64\test\
- cd %MyProjectDir%
- ls -R
- ps: cp -r $env:MyProjectDir\cvAutoTrack\x64\Compile\*.dll $env:MyProjectDir\x64\test\
- ps: cp -r $env:MyProjectDir\impl\Cpp\TEST_cvAutoTrack_Cpp\x64\Compile\*.exe $env:MyProjectDir\x64\test\
- ps: cp -r $env:MyProjectDir\impl\CSharp\TEST_cvAutoTrack_CSharp\bin\x64\Compile\net6.0\*.exe $env:MyProjectDir\x64\test\
- ps: cp -r $env:MyProjectDir\impl\CSharp\TEST_cvAutoTrack_CSharp\bin\x64\Compile\net6.0\*.dll $env:MyProjectDir\x64\test\
- ps: cp -r $env:MyProjectDir\impl\CSharp\TEST_cvAutoTrack_CSharp\bin\x64\Compile\net6.0\*.json $env:MyProjectDir\x64\test\
test_script:
- cd %MyProjectDir%\x64\test\
- dir
# 运行 C++ 测试
- TEST_cvAutoTrack_Cpp.exe -test
# 运行 C# 测试
- TEST_cvAutoTrack_CSharp.exe -test
after_test:
- cd %MyProjectDir%x64\build\
- echo %APPVEYOR_BUILD_VERSION% >version.tag
- md5sum -b %MyProjectDir%x64\build\%ProjectName%.dll | cut -c 2-34 >%ProjectName%.md5
- ps: cp -r $env:MyProjectDir\impl\Cpp\TEST_cvAutoTrack_Cpp\x64\Compile\TEST_cvAutoTrack_Cpp.exe $env:MyProjectDir\x64\build\
- appveyor PushArtifact version.tag
- appveyor PushArtifact %ProjectName%.md5
- appveyor PushArtifact cvAutoTrack.dll
- appveyor PushArtifact TEST_cvAutoTrack_Cpp.exe
-
version: '7.7.0.{build}'
os: Visual Studio 2022
configuration: Chore
platform:
- x64
branches:
only:
- /chore-/
environment:
MyProjectDir: C:\projects\cvAutoTrack\
OpenCvDir: C:\projects\opencv\
OpenCvUrl: https://github.com/GengGode/OpencvStaticLib/releases/download/4.6.0/Opencv.zip
ProjectName: cvAutoTrack
ProJectExeName: cvAutoTrack
skip_tags: true
install:
- ps: $env:TIME_STRING=(get-date -UFormat "%Y%m%d%a").ToString()
- echo Chore
- cd %MyProjectDir%
- ps: ./ci/install_opencv.ps1
#- ps: ./ci/clone_resource.ps1
before_build:
- git submodule update --init --recursive
- ps: ./ci/release_resource.ps1
build_script:
- MSBuild %MyProjectDir%cvAutoTrack\cvAutoTrack.vcxproj /p:configuration="Compile"
# 编译测试文件
- MSBuild %MyProjectDir%impl\Cpp\TEST_cvAutoTrack_Cpp\TEST_cvAutoTrack_Cpp.vcxproj /p:configuration="Compile"
- MSBuild %MyProjectDir%impl\CSharp\TEST_cvAutoTrack_CSharp\TEST_cvAutoTrack_CSharp.csproj /t:restore
- MSBuild %MyProjectDir%impl\CSharp\TEST_cvAutoTrack_CSharp\TEST_cvAutoTrack_CSharp.csproj /p:configuration="Compile"
after_build:
- echo %MyProjectDir%cvAutoTrack.sln 编译完成 等待测试
- mkdir %MyProjectDir%x64\build\
- ps: cp -r $env:MyProjectDir\cvAutoTrack\x64\Compile\*.dll $env:MyProjectDir\x64\build\
- ps: cp -r $env:MyProjectDir\cvAutoTrack\x64\Compile\*.lib $env:MyProjectDir\x64\build\
- ps: cp -r $env:MyProjectDir\cvAutoTrack\include\*.h $env:MyProjectDir\x64\build\
- ps: cp -r $env:MyProjectDir\impl\CSharp\TEST_cvAutoTrack_CSharp\cvAutoTrackCSharp.cs $env:MyProjectDir\x64\build\
before_test:
# 移动测试文件到test目录
- mkdir %MyProjectDir%x64\test\
- cd %MyProjectDir%
- ls -R
- ps: cp -r $env:MyProjectDir\cvAutoTrack\x64\Compile\*.dll $env:MyProjectDir\x64\test\
- ps: cp -r $env:MyProjectDir\cvAutoTrack\x64\Compile\*.lib $env:MyProjectDir\x64\test\
- ps: cp -r $env:MyProjectDir\cvAutoTrack\x64\Compile\*.pdb $env:MyProjectDir\x64\test\
- ps: cp -r $env:MyProjectDir\impl\Cpp\TEST_cvAutoTrack_Cpp\x64\Compile\*.exe $env:MyProjectDir\x64\test\
- ps: cp -r $env:MyProjectDir\impl\CSharp\TEST_cvAutoTrack_CSharp\bin\x64\Compile\net6.0\*.exe $env:MyProjectDir\x64\test\
- ps: cp -r $env:MyProjectDir\impl\CSharp\TEST_cvAutoTrack_CSharp\bin\x64\Compile\net6.0\*.dll $env:MyProjectDir\x64\test\
- ps: cp -r $env:MyProjectDir\impl\CSharp\TEST_cvAutoTrack_CSharp\bin\x64\Compile\net6.0\*.json $env:MyProjectDir\x64\test\
test_script:
- cd %MyProjectDir%\x64\test\
- dir
# 运行 C++ 测试
- TEST_cvAutoTrack_Cpp.exe -test
# 运行 C# 测试
- TEST_cvAutoTrack_CSharp.exe -test
- appveyor PushArtifact cvAutoTrack.dll
- appveyor PushArtifact cvAutoTrack.lib
- appveyor PushArtifact cvAutoTrack.pdb
- cd %MyProjectDir%
- ps: echo 获取版本号
- ps: git describe --tags | out-file version.ver
- ps: $version = Get-Content version.ver
- ps: echo (Get-Content version.ver)
- ps: 7z a -tZip cvAutoTrack-$version.zip $env:MyProjectDir\cvAutoTrack\x64\Compile\cvAutoTrack.dll
- ps: $buildversion = Get-Content version.ver
- ps: $commitLog = git log -1 --pretty=%B
- ps: $errCode = ./ci/upload_file.ps1
- ps: if($errCode -eq 0){./ci/manual_upload_release.ps1}