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