Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a2b037f

Browse files
committedAug 2, 2022
Scheduled rolling workflows
1 parent 2585d6f commit a2b037f

File tree

9 files changed

+332
-114
lines changed

9 files changed

+332
-114
lines changed
 

‎.github/workflows/build_wheels_linux.yml

Lines changed: 70 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build PYPI wheels for opencv-python on Linux x86_64
1+
name: Linux x86_64
22

33
on:
44
pull_request:
@@ -13,10 +13,13 @@ on:
1313
- '.github/workflows/build_wheels_macos*'
1414
release:
1515
types: [published, edited]
16+
schedule:
17+
- cron: '0 3 * * 6'
18+
workflow_dispatch:
1619

1720

1821
jobs:
19-
build:
22+
Build:
2023
runs-on: ubuntu-20.04
2124
defaults:
2225
run:
@@ -32,7 +35,7 @@ jobs:
3235
env:
3336
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
3437
REPO_DIR: .
35-
BUILD_COMMIT: master
38+
BUILD_COMMIT: ${{ github.ref }}
3639
PROJECT_SPEC: opencv-python
3740
MB_PYTHON_VERSION: ${{ matrix.python-version }}
3841
TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }}
@@ -46,33 +49,38 @@ jobs:
4649
SDIST: ${{ matrix.build_sdist || 0 }}
4750
ENABLE_HEADLESS: ${{ matrix.without_gui }}
4851
ENABLE_CONTRIB: ${{ matrix.with_contrib }}
52+
ENABLE_ROLLING: 1
4953
steps:
5054
- name: Cleanup
5155
run: find . -mindepth 1 -delete
5256
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
5364
- name: Checkout
54-
uses: actions/checkout@v2
65+
uses: actions/checkout@v3
5566
with:
5667
submodules: false
5768
fetch-depth: 0
58-
- name: Update submodules
59-
if: github.event_name == 'pull_request'
60-
run: git submodule update --remote
6169
- name: Build a package
6270
run: source scripts/build.sh
6371
- name: Saving all wheels
64-
uses: actions/upload-artifact@v2
72+
uses: actions/upload-artifact@v3
6573
with:
6674
name: wheels
6775
path: wheelhouse/opencv*.whl
6876
- name: Saving a wheel accordingly to matrix
69-
uses: actions/upload-artifact@v2
77+
uses: actions/upload-artifact@v3
7078
with:
7179
name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}
7280
path: wheelhouse/opencv*.whl
7381

74-
test:
75-
needs: [build]
82+
Test:
83+
needs: [Build]
7684
runs-on: ubuntu-20.04
7785
defaults:
7886
run:
@@ -97,21 +105,21 @@ jobs:
97105
run: find . -mindepth 1 -delete
98106
working-directory: ${{ github.workspace }}
99107
- name: Checkout
100-
uses: actions/checkout@v2
108+
uses: actions/checkout@v3
101109
with:
102110
submodules: true
103111
fetch-depth: 0
104112
- name: Setup Environment variables
105113
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
106114
- name: Download a wheel accordingly to matrix
107-
uses: actions/download-artifact@v2
115+
uses: actions/download-artifact@v3
108116
with:
109117
name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}
110118
path: wheelhouse/
111119
- name: Package installation and run tests
112120
run: source scripts/install.sh
113121

114-
build_sdist:
122+
Build_sdist:
115123
runs-on: ubuntu-20.04
116124
defaults:
117125
run:
@@ -127,7 +135,7 @@ jobs:
127135
env:
128136
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
129137
REPO_DIR: .
130-
BUILD_COMMIT: master
138+
BUILD_COMMIT: ${{ github.ref }}
131139
PROJECT_SPEC: opencv-python
132140
PLAT: x86_64
133141
MB_PYTHON_VERSION: ${{ matrix.python-version }}
@@ -142,20 +150,25 @@ jobs:
142150
SDIST: ${{ matrix.build_sdist || 0 }}
143151
ENABLE_HEADLESS: ${{ matrix.without_gui || 0 }}
144152
ENABLE_CONTRIB: ${{ matrix.with_contrib || 0 }}
153+
ENABLE_ROLLING: 1
145154
steps:
146155
- name: Cleanup
147156
run: find . -mindepth 1 -delete
148157
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
149165
- name: Checkout
150-
uses: actions/checkout@v2
166+
uses: actions/checkout@v3
151167
with:
152168
submodules: false
153169
fetch-depth: 0
154-
- name: Update submodules
155-
if: github.event_name == 'pull_request'
156-
run: git submodule update --remote
157170
- name: Set up Python ${{ matrix.python-version }}
158-
uses: actions/setup-python@v2
171+
uses: actions/setup-python@v4
159172
with:
160173
python-version: ${{ matrix.python-version }}
161174
architecture: ${{ matrix.platform }}
@@ -172,21 +185,51 @@ jobs:
172185
set -x
173186
echo "skipping tests because of sdist"
174187
- name: saving artifacts
175-
uses: actions/upload-artifact@v2
188+
uses: actions/upload-artifact@v3
176189
with:
177190
name: wheels
178191
path: dist/opencv*.tar.gz
179192

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:
181224
if: github.event_name == 'release' && github.event.release.prerelease
182-
needs: [build, build_sdist, test]
225+
needs: [Build, Build_sdist, Test]
183226
runs-on: ubuntu-20.04
184227
environment: test-opencv-python-release
185228
defaults:
186229
run:
187230
shell: bash
188231
steps:
189-
- uses: actions/download-artifact@v2
232+
- uses: actions/download-artifact@v3
190233
with:
191234
name: wheels
192235
path: wheelhouse/
@@ -195,16 +238,16 @@ jobs:
195238
python -m pip install twine
196239
python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_* wheelhouse/opencv-*
197240
198-
release_opencv_python:
241+
Release:
199242
if: github.event_name == 'release' && !github.event.release.prerelease
200-
needs: [build, build_sdist, test]
243+
needs: [Build, Build_sdist, Test]
201244
runs-on: ubuntu-20.04
202245
environment: opencv-python-release
203246
defaults:
204247
run:
205248
shell: bash
206249
steps:
207-
- uses: actions/download-artifact@v2
250+
- uses: actions/download-artifact@v3
208251
with:
209252
name: wheels
210253
path: wheelhouse/

‎.github/workflows/build_wheels_linux_arm.yml

Lines changed: 63 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build PYPI wheels for opencv-python on Linux ARM
1+
name: Linux ARM64
22

33
on:
44
pull_request:
@@ -13,10 +13,13 @@ on:
1313
- '.github/workflows/build_wheels_macos*'
1414
release:
1515
types: [published, edited]
16+
schedule:
17+
- cron: '0 3 * * 6'
18+
workflow_dispatch:
1619

1720

1821
jobs:
19-
build_arm:
22+
Build:
2023
runs-on: opencv-cn-lin-arm64
2124
defaults:
2225
run:
@@ -32,7 +35,7 @@ jobs:
3235
env:
3336
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
3437
REPO_DIR: .
35-
BUILD_COMMIT: master
38+
BUILD_COMMIT: ${{ github.ref }}
3639
PROJECT_SPEC: opencv-python
3740
MB_PYTHON_VERSION: ${{ matrix.python-version }}
3841
TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }}
@@ -46,32 +49,38 @@ jobs:
4649
SDIST: ${{ matrix.build_sdist || 0 }}
4750
ENABLE_HEADLESS: ${{ matrix.without_gui }}
4851
ENABLE_CONTRIB: ${{ matrix.with_contrib }}
52+
ENABLE_ROLLING: 1
4953
steps:
50-
- name: UID
51-
run: id -u
5254
- name: Cleanup
5355
run: find . -mindepth 1 -delete
5456
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
5564
- name: Checkout
56-
uses: actions/checkout@v2
65+
uses: actions/checkout@v3
5766
with:
5867
submodules: false
5968
fetch-depth: 0
6069
- name: Build a package
6170
run: source scripts/build.sh
6271
- name: Saving all wheels
63-
uses: actions/upload-artifact@v2
72+
uses: actions/upload-artifact@v3
6473
with:
6574
name: wheels
6675
path: wheelhouse/opencv*.whl
6776
- name: Saving a wheel accordingly to matrix
68-
uses: actions/upload-artifact@v2
77+
uses: actions/upload-artifact@v3
6978
with:
7079
name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}
7180
path: wheelhouse/opencv*.whl
7281

73-
test:
74-
needs: [build_arm]
82+
Test:
83+
needs: [Build]
7584
runs-on: opencv-cn-lin-arm64
7685
defaults:
7786
run:
@@ -88,6 +97,7 @@ jobs:
8897
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
8998
MB_PYTHON_VERSION: ${{ matrix.python-version }}
9099
PLAT: aarch64
100+
BUILD_COMMIT: ${{ github.ref }}
91101
NP_TEST_DEP: numpy==1.19.4
92102
NP_TEST_DEP_LATEST: numpy==1.21.4
93103
CONFIG_PATH: travis_config.sh
@@ -97,31 +107,66 @@ jobs:
97107
- name: Cleanup
98108
run: find . -mindepth 1 -delete
99109
working-directory: ${{ github.workspace }}
110+
- name: Setup environment
111+
run: |
112+
if [[ "${{ github.event.pull_request }}" == "true" ]]; then
113+
echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV
114+
fi
100115
- name: Checkout
101-
uses: actions/checkout@v2
116+
uses: actions/checkout@v3
102117
with:
103118
submodules: true
104119
fetch-depth: 0
105120
- name: Setup Environment variables
106121
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
107122
- name: Download a wheel accordingly to matrix
108-
uses: actions/download-artifact@v2
123+
uses: actions/download-artifact@v3
109124
with:
110125
name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}
111126
path: wheelhouse/
112127
- name: Package installation and run tests
113128
run: source scripts/install.sh
114129

115-
test_release_opencv_python:
130+
Release_rolling:
131+
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
132+
needs: [Build, Test]
133+
runs-on: ubuntu-20.04
134+
environment: opencv-python-rolling-release
135+
defaults:
136+
run:
137+
shell: bash
138+
steps:
139+
- uses: actions/download-artifact@v3
140+
with:
141+
name: wheels
142+
path: wheelhouse/
143+
- name: Upload wheels for opencv_python_rolling
144+
run: |
145+
python -m pip install twine
146+
python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_rolling-*
147+
- name: Upload wheels for opencv_contrib_python_rolling
148+
run: |
149+
python -m pip install twine
150+
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-*
151+
- name: Upload wheels for opencv_python_headless_rolling
152+
run: |
153+
python -m pip install twine
154+
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-*
155+
- name: Upload wheels for opencv_contrib_python_headless_rolling
156+
run: |
157+
python -m pip install twine
158+
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-*
159+
160+
Pre-release:
116161
if: github.event_name == 'release' && github.event.release.prerelease
117-
needs: [build_arm, test]
162+
needs: [Build, Test]
118163
runs-on: ubuntu-20.04
119164
environment: test-opencv-python-release
120165
defaults:
121166
run:
122167
shell: bash
123168
steps:
124-
- uses: actions/download-artifact@v2
169+
- uses: actions/download-artifact@v3
125170
with:
126171
name: wheels
127172
path: wheelhouse/
@@ -130,16 +175,16 @@ jobs:
130175
python -m pip install twine
131176
python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_*
132177
133-
release_opencv_python:
178+
Release:
134179
if: github.event_name == 'release' && !github.event.release.prerelease
135-
needs: [build_arm, test]
180+
needs: [Build, Test]
136181
runs-on: ubuntu-20.04
137182
environment: opencv-python-release
138183
defaults:
139184
run:
140185
shell: bash
141186
steps:
142-
- uses: actions/download-artifact@v2
187+
- uses: actions/download-artifact@v3
143188
with:
144189
name: wheels
145190
path: wheelhouse/

‎.github/workflows/build_wheels_macos.yml

Lines changed: 58 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build PYPI wheels for opencv-python on Macos
1+
name: macOS x86_64
22

33
on:
44
pull_request:
@@ -13,10 +13,13 @@ on:
1313
- '.github/workflows/build_wheels_macos_m1.yml'
1414
release:
1515
types: [published, edited]
16+
schedule:
17+
- cron: '0 3 * * 6'
18+
workflow_dispatch:
1619

1720

1821
jobs:
19-
build:
22+
Build:
2023
runs-on: ${{ matrix.os }}
2124
defaults:
2225
run:
@@ -44,34 +47,38 @@ jobs:
4447
env:
4548
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
4649
REPO_DIR: .
47-
BUILD_COMMIT: master
50+
BUILD_COMMIT: ${{ github.ref }}
4851
PROJECT_SPEC: opencv-python
4952
MB_PYTHON_VERSION: ${{ matrix.python-version }}
5053
TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }}
5154
MB_ML_VER: 2014
5255
TRAVIS_BUILD_DIR: ${{ github.workspace }}
5356
TRAVIS_OS_NAME: osx
5457
CONFIG_PATH: travis_config.sh
55-
DOCKER_IMAGE: quay.io/asenyaev/manylinux2014_${PLAT}
5658
USE_CCACHE: 1
5759
UNICODE_WIDTH: 32
5860
PLAT: x86_64
5961
FFMPEG_FORMULA_VERSION: '@4'
6062
SDIST: ${{ matrix.build_sdist || 0 }}
6163
ENABLE_HEADLESS: ${{ matrix.without_gui }}
6264
ENABLE_CONTRIB: ${{ matrix.with_contrib }}
65+
ENABLE_ROLLING: 1
6366
steps:
6467
- name: Cleanup
6568
run: find . -mindepth 1 -delete
6669
working-directory: ${{ github.workspace }}
70+
- name: Setup environment
71+
run: |
72+
if [[ "${{ github.event.pull_request }}" == "true" ]]; then
73+
echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV
74+
elif [[ "${{ github.event_name }}" == "schedule" ]]; then
75+
echo "ENABLE_ROLLING=1" >> $GITHUB_ENV
76+
fi
6777
- name: Checkout
68-
uses: actions/checkout@v2
78+
uses: actions/checkout@v3
6979
with:
7080
submodules: false
7181
fetch-depth: 0
72-
- name: Update submodules
73-
if: github.event_name == 'pull_request'
74-
run: git submodule update --remote
7582
- name: Build a package
7683
run: |
7784
set -e
@@ -90,18 +97,18 @@ jobs:
9097
set -x
9198
build_wheel $REPO_DIR $PLAT
9299
- name: Saving all wheels
93-
uses: actions/upload-artifact@v2
100+
uses: actions/upload-artifact@v3
94101
with:
95102
name: wheels
96103
path: wheelhouse/opencv*.whl
97104
- name: Saving a wheel accordingly to matrix
98-
uses: actions/upload-artifact@v2
105+
uses: actions/upload-artifact@v3
99106
with:
100107
name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}
101108
path: wheelhouse/opencv*.whl
102109

103-
test:
104-
needs: [build]
110+
Test:
111+
needs: [Build]
105112
runs-on: ${{ matrix.os }}
106113
defaults:
107114
run:
@@ -140,19 +147,19 @@ jobs:
140147
run: find . -mindepth 1 -delete
141148
working-directory: ${{ github.workspace }}
142149
- name: Checkout
143-
uses: actions/checkout@v2
150+
uses: actions/checkout@v3
144151
with:
145152
submodules: true
146153
fetch-depth: 0
147154
- name: Set up Python ${{ matrix.python-version }}
148-
uses: actions/setup-python@v2
155+
uses: actions/setup-python@v4
149156
with:
150157
python-version: ${{ matrix.python-version }}
151158
architecture: ${{ matrix.platform }}
152159
- name: Setup Environment variables
153160
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
154161
- name: Download a wheel accordingly to matrix
155-
uses: actions/download-artifact@v2
162+
uses: actions/download-artifact@v3
156163
with:
157164
name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}
158165
path: wheelhouse/
@@ -171,16 +178,46 @@ jobs:
171178
cd ${{ github.workspace }}/tests
172179
python -m pylint $PYLINT_TEST_FILE
173180
174-
test_release_opencv_python:
181+
Release_rolling:
182+
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
183+
needs: [Build, Test]
184+
runs-on: ubuntu-20.04
185+
environment: opencv-python-rolling-release
186+
defaults:
187+
run:
188+
shell: bash
189+
steps:
190+
- uses: actions/download-artifact@v3
191+
with:
192+
name: wheels
193+
path: wheelhouse/
194+
- name: Upload wheels for opencv_python_rolling
195+
run: |
196+
python -m pip install twine
197+
python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_rolling-*
198+
- name: Upload wheels for opencv_contrib_python_rolling
199+
run: |
200+
python -m pip install twine
201+
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-*
202+
- name: Upload wheels for opencv_python_headless_rolling
203+
run: |
204+
python -m pip install twine
205+
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-*
206+
- name: Upload wheels for opencv_contrib_python_headless_rolling
207+
run: |
208+
python -m pip install twine
209+
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-*
210+
211+
Pre-release:
175212
if: github.event_name == 'release' && github.event.release.prerelease
176-
needs: [build, test]
213+
needs: [Build, Test]
177214
runs-on: ubuntu-20.04
178215
environment: test-opencv-python-release
179216
defaults:
180217
run:
181218
shell: bash
182219
steps:
183-
- uses: actions/download-artifact@v2
220+
- uses: actions/download-artifact@v3
184221
with:
185222
name: wheels
186223
path: wheelhouse/
@@ -189,16 +226,16 @@ jobs:
189226
python -m pip install twine
190227
python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_*
191228
192-
release_opencv_python:
229+
Release:
193230
if: github.event_name == 'release' && !github.event.release.prerelease
194-
needs: [build, test]
231+
needs: [Build, Test]
195232
runs-on: ubuntu-20.04
196233
environment: opencv-python-release
197234
defaults:
198235
run:
199236
shell: bash
200237
steps:
201-
- uses: actions/download-artifact@v2
238+
- uses: actions/download-artifact@v3
202239
with:
203240
name: wheels
204241
path: wheelhouse/

‎.github/workflows/build_wheels_macos_m1.yml

Lines changed: 63 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build PYPI wheels for opencv-python on Macos M1
1+
name: macOS ARM64
22

33
on:
44
pull_request:
@@ -13,10 +13,13 @@ on:
1313
- '.github/workflows/build_wheels_macos.yml'
1414
release:
1515
types: [published, edited]
16+
schedule:
17+
- cron: '0 3 * * 6'
18+
workflow_dispatch:
1619

1720

1821
jobs:
19-
build:
22+
Build:
2023
runs-on: opencv-cn-mac-arm64
2124
strategy:
2225
fail-fast: false
@@ -27,22 +30,28 @@ jobs:
2730
without_gui: [0, 1]
2831
build_sdist: [0]
2932
env:
33+
BUILD_COMMIT: ${{ github.ref }}
3034
CI_BUILD: 1
3135
SDIST: ${{ matrix.build_sdist || 0 }}
3236
ENABLE_HEADLESS: ${{ matrix.without_gui }}
3337
ENABLE_CONTRIB: ${{ matrix.with_contrib }}
38+
ENABLE_ROLLING: 1
3439
steps:
3540
- name: Cleanup
3641
run: find . -mindepth 1 -delete
3742
working-directory: ${{ github.workspace }}
43+
- name: Setup environment
44+
run: |
45+
if [[ "${{ github.event.pull_request }}" == "true" ]]; then
46+
echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV
47+
elif [[ "${{ github.event_name }}" == "schedule" ]]; then
48+
echo "ENABLE_ROLLING=1" >> $GITHUB_ENV
49+
fi
3850
- name: Checkout
39-
uses: actions/checkout@v2
51+
uses: actions/checkout@v3
4052
with:
4153
submodules: false
4254
fetch-depth: 0
43-
- name: Update submodules
44-
if: github.event_name == 'pull_request'
45-
run: git submodule update --remote
4655
- name: Build a package
4756
run: |
4857
git submodule update --init multibuild
@@ -53,18 +62,18 @@ jobs:
5362
arch -arm64 python${{ matrix.python-version }} setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=wheelhouse -v
5463
delocate-wheel ${{ github.workspace }}/wheelhouse/opencv*
5564
- name: Saving all wheels
56-
uses: actions/upload-artifact@v2
65+
uses: actions/upload-artifact@v3
5766
with:
5867
name: wheels
5968
path: wheelhouse/opencv*.whl
6069
- name: Saving a wheel accordingly to matrix
61-
uses: actions/upload-artifact@v2
70+
uses: actions/upload-artifact@v3
6271
with:
6372
name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}
6473
path: wheelhouse/opencv*.whl
6574

66-
test:
67-
needs: [build]
75+
Test:
76+
needs: [Build]
6877
runs-on: opencv-cn-mac-arm64-tests
6978
strategy:
7079
fail-fast: false
@@ -75,19 +84,25 @@ jobs:
7584
without_gui: [0, 1]
7685
build_sdist: [0]
7786
env:
87+
BUILD_COMMIT: ${{ github.ref }}
7888
OPENCV_TEST_DATA_PATH: ${{ github.workspace }}/opencv_extra/testdata
7989
PYLINT_TEST_FILE: ${{ github.workspace }}/opencv/samples/python/squares.py
8090
steps:
8191
- name: Cleanup
8292
run: find . -mindepth 1 -delete
8393
working-directory: ${{ github.workspace }}
94+
- name: Setup environment
95+
run: |
96+
if [[ "${{ github.event.pull_request }}" == "true" ]]; then
97+
echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV
98+
fi
8499
- name: Checkout
85-
uses: actions/checkout@v2
100+
uses: actions/checkout@v3
86101
with:
87102
submodules: true
88103
fetch-depth: 0
89104
- name: Download a wheel accordingly to matrix
90-
uses: actions/download-artifact@v2
105+
uses: actions/download-artifact@v3
91106
with:
92107
name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}
93108
path: wheelhouse/
@@ -106,35 +121,64 @@ jobs:
106121
cd ${{ github.workspace }}/tests
107122
arch -arm64 python${{ matrix.python-version }} -m pylint $PYLINT_TEST_FILE
108123
109-
test_release_opencv_python:
124+
Release_rolling:
125+
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
126+
needs: [Build, Test]
127+
runs-on: ubuntu-20.04
128+
environment: opencv-python-rolling-release
129+
defaults:
130+
run:
131+
shell: bash
132+
steps:
133+
- uses: actions/download-artifact@v3
134+
with:
135+
name: wheels
136+
path: wheelhouse/
137+
- name: Upload wheels for opencv_python_rolling
138+
run: |
139+
python -m pip install twine
140+
python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_rolling-*
141+
- name: Upload wheels for opencv_contrib_python_rolling
142+
run: |
143+
python -m pip install twine
144+
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-*
145+
- name: Upload wheels for opencv_python_headless_rolling
146+
run: |
147+
python -m pip install twine
148+
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-*
149+
- name: Upload wheels for opencv_contrib_python_headless_rolling
150+
run: |
151+
python -m pip install twine
152+
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-*
153+
154+
Pre-release:
110155
if: github.event_name == 'release' && github.event.release.prerelease
111-
needs: [build, test]
156+
needs: [Build, Test]
112157
runs-on: ubuntu-20.04
113158
environment: test-opencv-python-release
114159
defaults:
115160
run:
116161
shell: bash
117162
steps:
118-
- uses: actions/download-artifact@v2
163+
- uses: actions/download-artifact@v3
119164
with:
120165
name: wheels
121166
path: wheelhouse/
122-
123167
- name: Upload all wheels
124168
run: |
125169
python -m pip install twine
126170
python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_*
127171
128-
release_opencv_python:
172+
Release:
129173
if: github.event_name == 'release' && !github.event.release.prerelease
130-
needs: [build, test]
174+
needs: [Build, Test]
131175
runs-on: ubuntu-20.04
132176
environment: opencv-python-release
133177
defaults:
134178
run:
135179
shell: bash
136180
steps:
137-
- uses: actions/download-artifact@v2
181+
- uses: actions/download-artifact@v3
138182
with:
139183
name: wheels
140184
path: wheelhouse/

‎.github/workflows/build_wheels_windows.yml

Lines changed: 57 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build PYPI wheels for opencv-python on Windows
1+
name: Windows x86/x64
22

33
on:
44
pull_request:
@@ -12,10 +12,13 @@ on:
1212
- '.github/workflows/build_wheels_macos*'
1313
release:
1414
types: [published, edited]
15+
schedule:
16+
- cron: '0 3 * * 6'
17+
workflow_dispatch:
1518

1619

1720
jobs:
18-
build-windows-x86_64:
21+
Build:
1922
runs-on: windows-2019
2023
strategy:
2124
fail-fast: false
@@ -30,6 +33,7 @@ jobs:
3033
SDIST: ${{ matrix.build_sdist || 0 }}
3134
ENABLE_HEADLESS: ${{ matrix.without_gui }}
3235
ENABLE_CONTRIB: ${{ matrix.with_contrib }}
36+
ENABLE_ROLLING: 1
3337
OPENCV_TEST_DATA_PATH: ${{ github.workspace }}\opencv_extra\testdata
3438
steps:
3539
- name: Cleanup
@@ -38,16 +42,19 @@ jobs:
3842
rm -rf ./* || true
3943
rm -rf ./.??* || true
4044
working-directory: ${{ github.workspace }}
45+
- name: Setup environment
46+
shell: bash
47+
run: |
48+
if [[ "${{ github.event_name }}" == "schedule" ]]; then
49+
echo "ENABLE_ROLLING=1" >> $GITHUB_ENV
50+
fi
4151
- name: Checkout
42-
uses: actions/checkout@v2
52+
uses: actions/checkout@v3
4353
with:
4454
submodules: false
4555
fetch-depth: 0
46-
- name: Update submodules
47-
if: github.event_name == 'pull_request'
48-
run: git submodule update --remote
4956
- name: Set up Python ${{ matrix.python-version }}
50-
uses: actions/setup-python@v2
57+
uses: actions/setup-python@v4
5158
with:
5259
python-version: ${{ matrix.python-version }}
5360
architecture: ${{ matrix.platform }}
@@ -62,18 +69,18 @@ jobs:
6269
set "CI_BUILD=1" && python setup.py bdist_wheel --py-limited-api=cp36 --dist-dir=%cd%\wheelhouse -v
6370
shell: cmd
6471
- name: Saving all wheels
65-
uses: actions/upload-artifact@v2
72+
uses: actions/upload-artifact@v3
6673
with:
6774
name: wheels
6875
path: wheelhouse/opencv*.whl
6976
- name: Saving a wheel accordingly to matrix
70-
uses: actions/upload-artifact@v2
77+
uses: actions/upload-artifact@v3
7178
with:
7279
name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }}
7380
path: wheelhouse/opencv*
7481

75-
test:
76-
needs: [build-windows-x86_64]
82+
Test:
83+
needs: [Build]
7784
runs-on: windows-2019
7885
defaults:
7986
run:
@@ -98,17 +105,17 @@ jobs:
98105
rm -rf ./.??* || true
99106
working-directory: ${{ github.workspace }}
100107
- name: Checkout
101-
uses: actions/checkout@v2
108+
uses: actions/checkout@v3
102109
with:
103110
submodules: true
104111
fetch-depth: 0
105112
- name: Set up Python ${{ matrix.python-version }}
106-
uses: actions/setup-python@v2
113+
uses: actions/setup-python@v4
107114
with:
108115
python-version: ${{ matrix.python-version }}
109116
architecture: ${{ matrix.platform }}
110117
- name: Download a wheel accordingly to matrix
111-
uses: actions/download-artifact@v2
118+
uses: actions/download-artifact@v3
112119
with:
113120
name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }}
114121
path: wheelhouse/
@@ -129,16 +136,46 @@ jobs:
129136
cd ${{ github.workspace }}\tests
130137
python -m pylint $PYLINT_TEST_FILE
131138
132-
test_release_opencv_python:
139+
Release_rolling:
140+
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
141+
needs: [Build, Test]
142+
runs-on: ubuntu-20.04
143+
environment: opencv-python-rolling-release
144+
defaults:
145+
run:
146+
shell: bash
147+
steps:
148+
- uses: actions/download-artifact@v3
149+
with:
150+
name: wheels
151+
path: wheelhouse/
152+
- name: Upload wheels for opencv_python_rolling
153+
run: |
154+
python -m pip install twine
155+
python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_rolling-*
156+
- name: Upload wheels for opencv_contrib_python_rolling
157+
run: |
158+
python -m pip install twine
159+
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-*
160+
- name: Upload wheels for opencv_python_headless_rolling
161+
run: |
162+
python -m pip install twine
163+
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-*
164+
- name: Upload wheels for opencv_contrib_python_headless_rolling
165+
run: |
166+
python -m pip install twine
167+
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-*
168+
169+
Pre-release:
133170
if: github.event_name == 'release' && github.event.release.prerelease
134-
needs: [build-windows-x86_64, test]
171+
needs: [Build, Test]
135172
runs-on: ubuntu-20.04
136173
environment: test-opencv-python-release
137174
defaults:
138175
run:
139176
shell: bash
140177
steps:
141-
- uses: actions/download-artifact@v2
178+
- uses: actions/download-artifact@v3
142179
with:
143180
name: wheels
144181
path: wheelhouse/
@@ -147,16 +184,16 @@ jobs:
147184
python -m pip install twine
148185
python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_*
149186
150-
release_opencv_python:
187+
Release:
151188
if: github.event_name == 'release' && !github.event.release.prerelease
152-
needs: [build-windows-x86_64, test]
189+
needs: [Build, Test]
153190
runs-on: ubuntu-20.04
154191
environment: opencv-python-release
155192
defaults:
156193
run:
157194
shell: bash
158195
steps:
159-
- uses: actions/download-artifact@v2
196+
- uses: actions/download-artifact@v3
160197
with:
161198
name: wheels
162199
path: wheelhouse/

‎find_version.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import sys
2-
import os
32
import subprocess
3+
from datetime import date
44

55
if __name__ == "__main__":
66
contrib = sys.argv[1]
77
headless = sys.argv[2]
8-
ci_build = sys.argv[3]
8+
rolling = sys.argv[3]
9+
ci_build = sys.argv[4]
910

1011
opencv_version = ""
1112
# dig out the version from OpenCV sources
@@ -56,6 +57,10 @@
5657
# tag identifies the build and should be a sequential revision number
5758
version = tag[0]
5859
opencv_version += ".{}".format(version)
60+
elif rolling:
61+
# rolling version identifier, will be published in a dedicated rolling PyPI repository
62+
version = date.today().strftime('%Y%m%d')
63+
opencv_version += "+{}".format(version)
5964
else:
6065
# local version identifier, not to be published on PyPI
6166
version = git_hash
@@ -65,4 +70,5 @@
6570
f.write('opencv_version = "{}"\n'.format(opencv_version))
6671
f.write("contrib = {}\n".format(contrib))
6772
f.write("headless = {}\n".format(headless))
73+
f.write("rolling = {}\n".format(rolling))
6874
f.write("ci_build = {}".format(ci_build))

‎scripts/build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ source multibuild/travis_steps.sh
1313
# source travis_multibuild_customize.sh
1414
echo $ENABLE_CONTRIB > contrib.enabled
1515
echo $ENABLE_HEADLESS > headless.enabled
16+
echo $ENABLE_ROLLING > rolling.enabled
1617
set -x
1718
build_wheel $REPO_DIR $PLAT

‎scripts/install.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ source multibuild/travis_steps.sh
1313
# source travis_multibuild_customize.sh
1414
echo $ENABLE_CONTRIB > contrib.enabled
1515
echo $ENABLE_HEADLESS > headless.enabled
16+
echo $ENABLE_ROLLING > rolling.enabled
1617
set -x
1718
install_run $PLAT
1819
set +x

‎setup.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ def main():
2121
build_contrib = get_build_env_var_by_name("contrib")
2222
build_headless = get_build_env_var_by_name("headless")
2323
build_java = "ON" if get_build_env_var_by_name("java") else "OFF"
24+
build_rolling = get_build_env_var_by_name("rolling")
2425

2526
install_requires = [
2627
'numpy>=1.13.3; python_version<"3.7"',
@@ -55,8 +56,8 @@ def main():
5556
["submodule", "update", "--init", "--recursive", "opencv_contrib"]
5657
)
5758

58-
package_version, build_contrib, build_headless = get_and_set_info(
59-
build_contrib, build_headless, is_CI_build
59+
package_version, build_contrib, build_headless, build_rolling = get_and_set_info(
60+
build_contrib, build_headless, build_rolling, is_CI_build
6061
)
6162

6263
# https://stackoverflow.com/questions/1405913/python-32bit-or-64bit-mode
@@ -73,6 +74,9 @@ def main():
7374
if build_headless and not build_contrib:
7475
package_name = "opencv-python-headless"
7576

77+
if build_rolling:
78+
package_name += "-rolling"
79+
7680
long_description = io.open("README.md", encoding="utf-8").read()
7781

7882
packages = ["cv2", "cv2.data"]
@@ -245,14 +249,14 @@ def main():
245249
skbuild.setup(
246250
name=package_name,
247251
version=package_version,
248-
url="https://github.com/skvark/opencv-python",
252+
url="https://github.com/opencv/opencv-python",
249253
license="MIT",
250254
description="Wrapper package for OpenCV python bindings.",
251255
long_description=long_description,
252256
long_description_content_type="text/markdown",
253257
packages=packages,
254258
package_data=package_data,
255-
maintainer="Olli-Pekka Heinisuo",
259+
maintainer="OpenCV Team",
256260
ext_modules=EmptyListWithLength(),
257261
install_requires=install_requires,
258262
python_requires=">=3.6",
@@ -446,7 +450,7 @@ def _classify_installed_files_override(
446450
)
447451

448452

449-
def get_and_set_info(contrib, headless, ci_build):
453+
def get_and_set_info(contrib, headless, rolling, ci_build):
450454
# cv2/version.py should be generated by running find_version.py
451455
version = {}
452456
here = os.path.abspath(os.path.dirname(__file__))
@@ -456,14 +460,14 @@ def get_and_set_info(contrib, headless, ci_build):
456460
# (in sdists the version.py file already exists)
457461
if os.path.exists(".git"):
458462
old_args = sys.argv.copy()
459-
sys.argv = ["", str(contrib), str(headless), str(ci_build)]
463+
sys.argv = ["", str(contrib), str(headless), str(rolling), str(ci_build)]
460464
runpy.run_path("find_version.py", run_name="__main__")
461465
sys.argv = old_args
462466

463467
with open(version_file) as fp:
464468
exec(fp.read(), version)
465469

466-
return version["opencv_version"], version["contrib"], version["headless"]
470+
return version["opencv_version"], version["contrib"], version["headless"], version["rolling"]
467471

468472

469473
def get_build_env_var_by_name(flag_name):

0 commit comments

Comments
 (0)
Please sign in to comment.