1
- name :Build PYPI wheels for opencv-python on Linux x86_64
1
+ name :Linux x86_64
2
2
3
3
on :
4
4
pull_request :
13
13
-' .github/workflows/build_wheels_macos*'
14
14
release :
15
15
types :[published, edited]
16
+ schedule :
17
+ -cron :' 0 3 * * 6'
18
+ workflow_dispatch :
16
19
17
20
18
21
jobs :
19
- build :
22
+ Build :
20
23
runs-on :ubuntu-20.04
21
24
defaults :
22
25
run :
32
35
env :
33
36
ACTIONS_ALLOW_UNSECURE_COMMANDS :true
34
37
REPO_DIR :.
35
- BUILD_COMMIT :master
38
+ BUILD_COMMIT :${{ github.ref }}
36
39
PROJECT_SPEC :opencv-python
37
40
MB_PYTHON_VERSION :${{ matrix.python-version }}
38
41
TRAVIS_PYTHON_VERSION :${{ matrix.python-version }}
@@ -50,29 +53,33 @@ jobs:
50
53
-name :Cleanup
51
54
run :find . -mindepth 1 -delete
52
55
working-directory :${{ github.workspace }}
56
+ -name :Setup environment
57
+ run :|
58
+ if [[ "${{ github.event.pull_request }}" == "true" ]]; then
59
+ echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV
60
+ elif [[ "${{ github.event_name }}" == "schedule" ]]; then
61
+ echo "ENABLE_ROLLING=1" >> $GITHUB_ENV
62
+ fi
53
63
-name :Checkout
54
- uses :actions/checkout@v2
64
+ uses :actions/checkout@v3
55
65
with :
56
66
submodules :false
57
67
fetch-depth :0
58
- -name :Update submodules
59
- if :github.event_name == 'pull_request'
60
- run :git submodule update --remote
61
68
-name :Build a package
62
69
run :source scripts/build.sh
63
70
-name :Saving all wheels
64
- uses :actions/upload-artifact@v2
71
+ uses :actions/upload-artifact@v3
65
72
with :
66
73
name :wheels
67
74
path :wheelhouse/opencv*.whl
68
75
-name :Saving a wheel accordingly to matrix
69
- uses :actions/upload-artifact@v2
76
+ uses :actions/upload-artifact@v3
70
77
with :
71
78
name :wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}
72
79
path :wheelhouse/opencv*.whl
73
80
74
- test :
75
- needs :[build ]
81
+ Test :
82
+ needs :[Build ]
76
83
runs-on :ubuntu-20.04
77
84
defaults :
78
85
run :
@@ -97,21 +104,21 @@ jobs:
97
104
run :find . -mindepth 1 -delete
98
105
working-directory :${{ github.workspace }}
99
106
-name :Checkout
100
- uses :actions/checkout@v2
107
+ uses :actions/checkout@v3
101
108
with :
102
109
submodules :true
103
110
fetch-depth :0
104
111
-name :Setup Environment variables
105
112
run :if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi
106
113
-name :Download a wheel accordingly to matrix
107
- uses :actions/download-artifact@v2
114
+ uses :actions/download-artifact@v3
108
115
with :
109
116
name :wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}
110
117
path :wheelhouse/
111
118
-name :Package installation and run tests
112
119
run :source scripts/install.sh
113
120
114
- build_sdist :
121
+ Build_sdist :
115
122
runs-on :ubuntu-20.04
116
123
defaults :
117
124
run :
@@ -127,7 +134,7 @@ jobs:
127
134
env :
128
135
ACTIONS_ALLOW_UNSECURE_COMMANDS :true
129
136
REPO_DIR :.
130
- BUILD_COMMIT :master
137
+ BUILD_COMMIT :${{ github.ref }}
131
138
PROJECT_SPEC :opencv-python
132
139
PLAT :x86_64
133
140
MB_PYTHON_VERSION :${{ matrix.python-version }}
@@ -142,20 +149,25 @@ jobs:
142
149
SDIST :${{ matrix.build_sdist || 0 }}
143
150
ENABLE_HEADLESS :${{ matrix.without_gui || 0 }}
144
151
ENABLE_CONTRIB :${{ matrix.with_contrib || 0 }}
152
+ ENABLE_ROLLING :1
145
153
steps :
146
154
-name :Cleanup
147
155
run :find . -mindepth 1 -delete
148
156
working-directory :${{ github.workspace }}
157
+ -name :Setup environment
158
+ run :|
159
+ if [[ "${{ github.event.pull_request }}" == "true" ]]; then
160
+ echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV
161
+ elif [[ "${{ github.event_name }}" == "schedule" ]]; then
162
+ echo "ENABLE_ROLLING=1" >> $GITHUB_ENV
163
+ fi
149
164
-name :Checkout
150
- uses :actions/checkout@v2
165
+ uses :actions/checkout@v3
151
166
with :
152
167
submodules :false
153
168
fetch-depth :0
154
- -name :Update submodules
155
- if :github.event_name == 'pull_request'
156
- run :git submodule update --remote
157
169
-name :Set up Python ${{ matrix.python-version }}
158
- uses :actions/setup-python@v2
170
+ uses :actions/setup-python@v4
159
171
with :
160
172
python-version :${{ matrix.python-version }}
161
173
architecture :${{ matrix.platform }}
@@ -172,21 +184,51 @@ jobs:
172
184
set -x
173
185
echo "skipping tests because of sdist"
174
186
-name :saving artifacts
175
- uses :actions/upload-artifact@v2
187
+ uses :actions/upload-artifact@v3
176
188
with :
177
189
name :wheels
178
190
path :dist/opencv*.tar.gz
179
191
180
- test_release_opencv_python :
192
+ Release_rolling :
193
+ if :${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
194
+ needs :[Build, Build_sdist, Test]
195
+ runs-on :ubuntu-20.04
196
+ environment :opencv-python-rolling-release
197
+ defaults :
198
+ run :
199
+ shell :bash
200
+ steps :
201
+ -uses :actions/download-artifact@v3
202
+ with :
203
+ name :wheels
204
+ path :wheelhouse/
205
+ -name :Upload wheels for opencv_python_rolling
206
+ run :|
207
+ python -m pip install twine
208
+ python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_rolling-* wheelhouse/opencv-python-rolling-[^h]*
209
+ -name :Upload wheels for opencv_contrib_python_rolling
210
+ run :|
211
+ python -m pip install twine
212
+ python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_rolling-* wheelhouse/opencv-contrib-python-rolling-[^h]*
213
+ -name :Upload wheels for opencv_python_headless_rolling
214
+ run :|
215
+ python -m pip install twine
216
+ python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless_rolling-* wheelhouse/opencv-python-headless-rolling-*
217
+ -name :Upload wheels for opencv_contrib_python_headless_rolling
218
+ run :|
219
+ python -m pip install twine
220
+ python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless_rolling-* wheelhouse/opencv-contrib-python-headless-rolling-*
221
+
222
+ Pre-release :
181
223
if :github.event_name == 'release' && github.event.release.prerelease
182
- needs :[build, build_sdist, test ]
224
+ needs :[Build, Build_sdist, Test ]
183
225
runs-on :ubuntu-20.04
184
226
environment :test-opencv-python-release
185
227
defaults :
186
228
run :
187
229
shell :bash
188
230
steps :
189
- -uses :actions/download-artifact@v2
231
+ -uses :actions/download-artifact@v3
190
232
with :
191
233
name :wheels
192
234
path :wheelhouse/
@@ -195,16 +237,16 @@ jobs:
195
237
python -m pip install twine
196
238
python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_* wheelhouse/opencv-*
197
239
198
- release_opencv_python :
240
+ Release :
199
241
if :github.event_name == 'release' && !github.event.release.prerelease
200
- needs :[build, build_sdist, test ]
242
+ needs :[Build, Build_sdist, Test ]
201
243
runs-on :ubuntu-20.04
202
244
environment :opencv-python-release
203
245
defaults :
204
246
run :
205
247
shell :bash
206
248
steps :
207
- -uses :actions/download-artifact@v2
249
+ -uses :actions/download-artifact@v3
208
250
with :
209
251
name :wheels
210
252
path :wheelhouse/