-
Notifications
You must be signed in to change notification settings - Fork 2
172 lines (165 loc) · 6.24 KB
/
windows.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
name: windows
on:
push:
tags:
- "*"
pull_request:
branches: ["main"]
env:
FFMPEG_ROOT: C:\ffmpeg
SOURCE_DIR: opencv
jobs:
windows:
strategy:
matrix:
opencv-version: [4.10.0]
os:
- { arch: x64, toolset-version: v142 }
runs-on: windows-2019
env:
UseMultiToolTask: true
PACKAGE_NAME: libopencv-windows-${{ matrix.os.arch }}
COMMON_CMAKE_OPTIONS: |
$(type ${{ github.workspace }}/options.txt) `
-G "Visual Studio 16 2019" `
-DCMAKE_INSTALL_PREFIX=install `
-DOPENCV_EXTRA_MODULES_PATH="${{ github.workspace }}/opencv_contrib/modules" `
-DCMAKE_POLICY_DEFAULT_CMP0074=NEW `
-DFFMPEG_ARCH=${{ matrix.os.arch }} `
steps:
- uses: actions/checkout@v4
- name: setup-opencv-source
run: |
git clone -b ${{ matrix.opencv-version }} https://github.com/opencv/opencv.git ${{ env.SOURCE_DIR }}
git apply -p 0 patches/opencv-4.10.0-detect_ffmpeg.patch
git clone -b ${{ matrix.opencv-version }} https://github.com/opencv/opencv_contrib.git opencv_contrib
- name: download ffmpeg
uses: robinraju/release-downloader@v1.10
with:
repository: "rainyl/FFmpeg-Builds"
latest: true
fileName: "ffmpeg-n6.1-latest-win64-lgpl-shared-6.1.zip"
out-file-path: 'ffmpeg_tmp'
extract: true
- name: setup ffmpeg
run: |
ls ffmpeg_tmp
mkdir -Force $env:FFMPEG_ROOT/cmake
Move-Item -Force ffmpeg_tmp\*\* $env:FFMPEG_ROOT
cp -Recurse -Force ${{ github.workspace }}/cmake/ffmpeg-config.cmake $env:FFMPEG_ROOT/cmake/
- name: build
run: |
mkdir -Force ${{ env.SOURCE_DIR }}/build
cd ${{ env.SOURCE_DIR }}/build
cmake ${{ env.COMMON_CMAKE_OPTIONS }} -S .. `
-DFFMPEG_DIR="$env:FFMPEG_ROOT/cmake"
cmake --build . --config Release --target install -j 4
- name: package
run: |
mkdir ${{ env.PACKAGE_NAME }}
Copy-Item -Verbose -Recurse -Path "${{ env.SOURCE_DIR }}\build\install\*" -Destination "${{ env.PACKAGE_NAME }}"
cp -Recurse -Force $env:FFMPEG_ROOT ${{ env.PACKAGE_NAME }}/ffmpeg
tar -C ${{ env.PACKAGE_NAME }} -zcvf ${{ env.PACKAGE_NAME }}.tar.gz .
- name: test
run: |
cd test
mkdir build; cd build
cmake -T ${{ matrix.os.toolset-version }},host=x64 `
-DCMAKE_INSTALL_PREFIX=install `
-A x64 `
-DOpenCV_DIR="${{ github.workspace }}\${{ env.PACKAGE_NAME }}" `
-DFFMPEG_DIR="$env:FFMPEG_ROOT/cmake" `
-DOpenCV_STATIC=ON ..
cmake --build . --config Release -j 4
- name: upload
uses: actions/upload-artifact@v4
with:
name: ${{ env.PACKAGE_NAME }}
path: ${{ env.PACKAGE_NAME }}.tar.gz
- name: release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
prerelease: false
files: |
${{ env.PACKAGE_NAME }}.tar.gz
windows-arm64:
strategy:
matrix:
opencv-version: [4.10.0]
os:
- { arch: arm64, toolset-version: v142 }
runs-on: windows-2019
env:
UseMultiToolTask: true
PACKAGE_NAME: libopencv-windows-${{ matrix.os.arch }}
COMMON_CMAKE_OPTIONS: |
$(type ${{ github.workspace }}/options.txt) `
-G "Visual Studio 16 2019" `
-DCMAKE_INSTALL_PREFIX=install `
-DOPENCV_EXTRA_MODULES_PATH="${{ github.workspace }}/opencv_contrib/modules" `
-DCMAKE_POLICY_DEFAULT_CMP0074=NEW `
-A ARM64 `
-DCMAKE_SYSTEM_NAME=Windows `
-DCMAKE_SYSTEM_PROCESSOR=ARM64 `
-DFFMPEG_ARCH=${{ matrix.os.arch }} `
steps:
- uses: actions/checkout@v4
- name: setup-opencv-source
run: |
git clone -b ${{ matrix.opencv-version }} https://github.com/opencv/opencv.git ${{ env.SOURCE_DIR }}
git apply -p 0 patches/opencv-4.10.0-detect_ffmpeg.patch
git clone -b ${{ matrix.opencv-version }} https://github.com/opencv/opencv_contrib.git opencv_contrib
- name: download ffmpeg
uses: robinraju/release-downloader@v1.10
with:
repository: "rainyl/FFmpeg-Builds"
latest: true
fileName: "ffmpeg-n6.1-latest-winarm64-lgpl-shared-6.1.zip"
out-file-path: 'ffmpeg_tmp'
extract: true
- name: setup ffmpeg
run: |
ls ffmpeg_tmp
mkdir -Force $env:FFMPEG_ROOT/cmake
Move-Item -Force ffmpeg_tmp\*\* $env:FFMPEG_ROOT
cp -Recurse -Force ${{ github.workspace }}/cmake/ffmpeg-config.cmake $env:FFMPEG_ROOT/cmake/
- name: build
run: |
mkdir -Force ${{ env.SOURCE_DIR }}/build
cd ${{ env.SOURCE_DIR }}/build
cmake ${{ env.COMMON_CMAKE_OPTIONS }} -S .. `
-DWITH_IPP=OFF `
-DFFMPEG_DIR="$env:FFMPEG_ROOT/cmake"
cmake --build . --config Release --target install -j 4
- name: package
run: |
mkdir ${{ env.PACKAGE_NAME }}
Copy-Item -Verbose -Recurse -Path "${{ env.SOURCE_DIR }}\build\install\*" -Destination "${{ env.PACKAGE_NAME }}"
cp -Recurse -Force $env:FFMPEG_ROOT ${{ env.PACKAGE_NAME }}/ffmpeg
tar -C ${{ env.PACKAGE_NAME }} -zcvf ${{ env.PACKAGE_NAME }}.tar.gz .
- name: test
run: |
cd test
mkdir build; cd build
cmake -T ${{ matrix.os.toolset-version }},host=x64 `
-DCMAKE_INSTALL_PREFIX=install `
-A ARM64 `
-DOpenCV_DIR="${{ github.workspace }}\${{ env.PACKAGE_NAME }}" `
-DFFMPEG_DIR="$env:FFMPEG_ROOT/cmake" `
-DOpenCV_STATIC=ON ..
cmake --build . --config Release -j 4
- name: upload
uses: actions/upload-artifact@v4
with:
name: ${{ env.PACKAGE_NAME }}
path: ${{ env.PACKAGE_NAME }}.tar.gz
- name: release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
prerelease: false
files: |
${{ env.PACKAGE_NAME }}.tar.gz