forked from shimat/opencvsharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml
197 lines (179 loc) · 8.29 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
version: '4.1.0-{build}'
#environment:
# APPVEYOR_SAVE_CACHE_ON_ERROR: false
# VCPKG_BUILD_TYPE: Release
init:
- ps: |
Write-Host "APPVEYOR_BUILD_VERSION = "$env:APPVEYOR_BUILD_VERSION
if ($isWindows) {
$version = $env:APPVEYOR_BUILD_VERSION.Split('-')[0]
Write-Host "version = "$version
$date = Get-Date -Format "yyyyMMdd"
Update-AppveyorBuild -Version "$version.$date-beta-$env:APPVEYOR_BUILD_NUMBER"
Write-Host "APPVEYOR_BUILD_VERSION = "$env:APPVEYOR_BUILD_VERSION
}
iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
Write-Host "APPVEYOR = "$env:APPVEYOR
Write-Host "CI = "$env:CI
Write-Host "APPVEYOR_API_URL = "$env:APPVEYOR_API_URL
Write-Host "APPVEYOR_ACCOUNT_NAME = "$env:APPVEYOR_ACCOUNT_NAME
Write-Host "APPVEYOR_PROJECT_ID = "$env:APPVEYOR_PROJECT_ID
Write-Host "APPVEYOR_PROJECT_NAME = "$env:APPVEYOR_PROJECT_NAME
Write-Host "APPVEYOR_PROJECT_SLUG = "$env:APPVEYOR_PROJECT_SLUG
Write-Host "APPVEYOR_BUILD_FOLDER = "$env:APPVEYOR_BUILD_FOLDER
Write-Host "APPVEYOR_BUILD_ID = "$env:APPVEYOR_BUILD_ID
Write-Host "APPVEYOR_BUILD_NUMBER = "$env:APPVEYOR_BUILD_NUMBER
Write-Host "APPVEYOR_BUILD_VERSION = "$env:APPVEYOR_BUILD_VERSION
Write-Host "APPVEYOR_BUILD_WORKER_IMAGE = "$env:APPVEYOR_BUILD_WORKER_IMAGE
Write-Host "APPVEYOR_PULL_REQUEST_NUMBER = "$env:APPVEYOR_PULL_REQUEST_NUMBER
Write-Host "APPVEYOR_PULL_REQUEST_TITLE = "$env:APPVEYOR_PULL_REQUEST_TITLE
Write-Host "APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME = "$env:APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME
Write-Host "APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH = "$env:APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH
Write-Host "APPVEYOR_PULL_REQUEST_HEAD_COMMIT = "$env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT
Write-Host "APPVEYOR_JOB_ID = "$env:APPVEYOR_JOB_ID
Write-Host "APPVEYOR_JOB_NAME = "$env:APPVEYOR_JOB_NAME
Write-Host "APPVEYOR_JOB_NUMBER = "$env:APPVEYOR_JOB_NUMBER
Write-Host "APPVEYOR_REPO_PROVIDER = "$env:APPVEYOR_REPO_PROVIDER
Write-Host "APPVEYOR_REPO_SCM = "$env:APPVEYOR_REPO_SCM
Write-Host "APPVEYOR_REPO_NAME = "$env:APPVEYOR_REPO_NAME
Write-Host "APPVEYOR_REPO_BRANCH = "$env:APPVEYOR_REPO_BRANCH
Write-Host "APPVEYOR_REPO_TAG = "$env:APPVEYOR_REPO_TAG
Write-Host "APPVEYOR_REPO_TAG_NAME = "$env:APPVEYOR_REPO_TAG_NAME
Write-Host "APPVEYOR_REPO_COMMIT = "$env:APPVEYOR_REPO_COMMIT
Write-Host "APPVEYOR_REPO_COMMIT_AUTHOR = "$env:APPVEYOR_REPO_COMMIT_AUTHOR
Write-Host "APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL = "$env:APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL
Write-Host "APPVEYOR_REPO_COMMIT_TIMESTAMP = "$env:APPVEYOR_REPO_COMMIT_TIMESTAMP
Write-Host "APPVEYOR_REPO_COMMIT_MESSAGE = "$env:APPVEYOR_REPO_COMMIT_MESSAGE
Write-Host "APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED = "$env:APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED
Write-Host "APPVEYOR_SCHEDULED_BUILD = "$env:APPVEYOR_SCHEDULED_BUILD
Write-Host "PLATFORM = "$env:PLATFORM
Write-Host "CONFIGURATION = "$env:CONFIGURATION
Write-Host "APPVEYOR_SAVE_CACHE_ON_ERROR = "$env:APPVEYOR_SAVE_CACHE_ON_ERROR
#on_finish:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
# Do not build feature branch with open Pull Requests
skip_branch_with_pr: true
image:
- Ubuntu1804
- Visual Studio 2019
configuration: Release
#platform:
# - x64
# - x86
#matrix:
#fast_finish: true
#exclude:
# - image: Ubuntu1804
# platform: x86
cache:
#- c:\tools\vcpkg\installed\
#- c:\tools\vcpkg\installed\ -> appveyor.yml
- packages -> **\packages.config
install:
# update vcpkg
#- cd C:\Tools\vcpkg
#- git pull
#- .\bootstrap-vcpkg.bat
#- cd %APPVEYOR_BUILD_FOLDER%
# - cmd: cd c:\tools\vcpkg
# - cmd: vcpkg list
# - cmd: vcpkg integrate remove
# - cmd: SET VCPKG_BUILD_TYPE=release
# - cmd: vcpkg integrate install
# - cmd: if %PLATFORM% == x64 vcpkg install tesseract:x64-windows-static
# - cmd: if %PLATFORM% == x86 vcpkg install tesseract:x86-windows-static
# - cmd: cd %APPVEYOR_BUILD_FOLDER%
# - cmd: vcpkg list
- sh: pwd
- sh: sudo apt update
- sh: sudo apt -y remove x264 libx264-dev
- sh: sudo apt -y install build-essential checkinstall cmake pkg-config yasm
- sh: sudo apt -y install git gfortran
- sh: sudo apt -y install libjpeg8-dev libpng-dev
- sh: sudo apt -y install software-properties-common
- sh: sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"
- sh: sudo apt -y update
- sh: sudo apt -y install libjasper1
- sh: sudo apt -y install libtiff-dev
- sh: sudo apt -y install libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev
- sh: sudo apt -y install libxine2-dev libv4l-dev
- sh: cd /usr/include/linux
- sh: sudo ln -s -f ../libv4l1-videodev.h videodev.h
- sh: cd $APPVEYOR_BUILD_FOLDER
- sh: sudo apt -y install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
- sh: sudo apt -y install libgtk2.0-dev libtbb-dev qt5-default
- sh: sudo apt -y install libatlas-base-dev
- sh: sudo apt -y install libfaac-dev libmp3lame-dev libtheora-dev
- sh: sudo apt -y install libvorbis-dev libxvidcore-dev
- sh: sudo apt -y install libopencore-amrnb-dev libopencore-amrwb-dev
- sh: sudo apt -y install libavresample-dev
- sh: sudo apt -y install x264 v4l-utils
- sh: sudo apt -y install libwebp-dev
- sh: sudo apt -y install tesseract-ocr libtesseract-dev libleptonica-dev
- sh: pwd; ls;
- sh: wget https://github.com/opencv/opencv/archive/4.1.0.zip -Oopencv-4.1.0.zip
- sh: wget https://github.com/opencv/opencv_contrib/archive/4.1.0.zip -Oopencv_contrib-4.1.0.zip
- sh: unzip opencv-4.1.0.zip
- sh: unzip opencv_contrib-4.1.0.zip
- sh: cd opencv-4.1.0 && mkdir build && cd build
- sh: cmake -DCMAKE_BUILD_TYPE=Release -DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-4.1.0/modules -DENABLE_CXX11=ON -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_opencv_java=OFF -DBUILD_opencv_python=OFF -DCMAKE_INSTALL_PREFIX=${APPVEYOR_BUILD_FOLDER}/opencv_ubuntu ..
- sh: make -j2
- sh: sudo make install
- sh: sudo ldconfig
- sh: cd ${APPVEYOR_BUILD_FOLDER}
- sh: pwd
- sh: ls
- sh: ls opencv_ubuntu
before_build:
- cmd: git submodule update --init --recursive
- cmd: nuget restore
#- dotnet restore
build_script:
- cmd: msbuild OpenCvSharp.sln /t:build /p:configuration=%CONFIGURATION% /p:platform=x64 -maxcpucount
- cmd: msbuild OpenCvSharp.sln /t:build /p:configuration=%CONFIGURATION% /p:platform=x86 -maxcpucount
- sh: mkdir src/build && cd $_
- sh: cmake -D CMAKE_PREFIX_PATH=${APPVEYOR_BUILD_FOLDER}/opencv_ubuntu ..
- sh: make -j2
- sh: pwd
- sh: ls
- sh: ls OpenCvSharpExtern
- sh: cp OpenCvSharpExtern/libOpenCvSharpExtern.so ${APPVEYOR_BUILD_FOLDER}/nuget/
after_build:
- ps: |
(Get-ChildItem $env:APPVEYOR_BUILD_FOLDER -Recurse).Where{ $_.Extension -eq ".nuspec" }.ForEach{
[xml]$xml = Get-Content $_.FullName
$xml.package.metadata.version = $env:APPVEYOR_BUILD_VERSION
$xml.Save($_.FullName)
}
if ($isWindows) {
nuget pack nuget/OpenCvSharp4.nuspec -OutputDirectory artifacts
nuget pack nuget/OpenCvSharp4.Windows.nuspec -OutputDirectory artifacts
nuget pack nuget/OpenCvSharp4.runtime.win.nuspec -OutputDirectory artifacts
} else {
nuget pack $env:APPVEYOR_BUILD_FOLDER/nuget/OpenCvSharp4.runtime.ubuntu.18.04-x64.nuspec -OutputDirectory $env:APPVEYOR_BUILD_FOLDER/artifacts_ubuntu
}
test_script:
- cmd: cd %APPVEYOR_BUILD_FOLDER%
- cmd: cd test
- cmd: cd OpenCvSharp.Tests
- cmd: dotnet test -c Release -f net472 #--no-build
- cmd: dotnet test -c Release -f netcoreapp2.1 #--no-build
- cmd: cd %APPVEYOR_BUILD_FOLDER%
artifacts:
- path: artifacts\**\*.*
- path: artifacts_ubuntu/**/*.*
#- path: src/build/OpenCvSharpExtern
#- path: src\Release\x64\OpenCvSharpExtern.dll
#- path: src\Release\Win32\OpenCvSharpExtern.dll
deploy:
- provider: NuGet # appveyor
server: https://ci.appveyor.com/nuget/shimat
api_key:
secure: PW0F7tbGr+QLuLPUGy+32pNtMZUJeqjyikz9nKlpALA=
skip_symbols: true
artifact: /.*\.nupkg/
#- provider: NuGet # nuget.org
# api_key:
# secure: qea/3lnas374qyS4Xw9t5Z5jBKsVsBPGsY938QHgJ2IQyrQmug0qPKDU7tll/QkJ
# skip_symbols: true
# artifact: /.*\.nupkg/