|
9 | 9 | - '.github/workflows/build_wheels_manylinux*' |
10 | 10 | - '.github/workflows/build_wheels_windows*' |
11 | 11 | - '.github/workflows/build_wheels_macos_m1.yml' |
12 | | - release: |
13 | | - types: [published, edited] |
14 | | - schedule: |
15 | | - - cron: '0 3 * * 6' |
| 12 | + - '.github/workflows/build_sdist.yml' |
| 13 | + - '.github/workflows/release.yml' |
| 14 | + workflow_call: |
| 15 | + inputs: |
| 16 | + rolling: |
| 17 | + type: boolean |
| 18 | + default: false |
16 | 19 | workflow_dispatch: |
17 | 20 |
|
| 21 | +permissions: |
| 22 | + contents: read |
18 | 23 |
|
19 | 24 | jobs: |
20 | 25 | Build: |
21 | | - runs-on: python-macos-intel |
| 26 | + runs-on: macos-15-intel |
22 | 27 | strategy: |
23 | 28 | fail-fast: false |
24 | 29 | matrix: |
@@ -46,37 +51,38 @@ jobs: |
46 | 51 | ENABLE_CONTRIB: ${{ matrix.with_contrib }} |
47 | 52 | PIP_INDEX_URL: https://pypi.tuna.tsinghua.edu.cn/simple |
48 | 53 | steps: |
49 | | - - name: Cleanup |
50 | | - run: find . -mindepth 1 -delete |
51 | | - working-directory: ${{ github.workspace }} |
52 | 54 | - name: Setup environment |
| 55 | + if: inputs.rolling == 'true' || github.event_name == 'workflow_dispatch' |
53 | 56 | run: | |
54 | | - if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then |
55 | | - echo "ENABLE_ROLLING=1" >> $GITHUB_ENV |
56 | | - fi |
| 57 | + echo "ENABLE_ROLLING=1" >> $GITHUB_ENV |
57 | 58 | - name: Checkout |
58 | 59 | uses: actions/checkout@v7 |
59 | 60 | with: |
60 | 61 | submodules: false |
61 | 62 | fetch-depth: 0 |
| 63 | + - name: Set up Python ${{ matrix.python-version }} |
| 64 | + uses: actions/setup-python@v7 |
| 65 | + with: |
| 66 | + python-version: ${{ matrix.python-version }} |
| 67 | + architecture: ${{ matrix.platform }} |
62 | 68 | - name: Build a package |
63 | 69 | run: | |
64 | 70 | git submodule update --init multibuild |
65 | 71 | echo $ENABLE_CONTRIB > contrib.enabled |
66 | 72 | echo $ENABLE_HEADLESS > headless.enabled |
67 | 73 | export MACOSX_DEPLOYMENT_TARGET=14.0 |
68 | | - python${{ matrix.python-version }} -m pip install toml && python${{ matrix.python-version }} -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["build-system"]["requires"]))' | python${{ matrix.python-version }} -m pip install -r /dev/stdin |
69 | | - python${{ matrix.python-version }} setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=wheelhouse -v |
| 74 | + python -m pip install toml && python -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["build-system"]["requires"]))' | python -m pip install -r /dev/stdin |
| 75 | + python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=wheelhouse -v |
70 | 76 | delocate-wheel ${{ github.workspace }}/wheelhouse/opencv* |
71 | 77 | - name: Saving a wheel accordingly to matrix |
72 | 78 | uses: actions/upload-artifact@v7 |
73 | 79 | with: |
74 | | - name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} |
| 80 | + name: build-${{ matrix.platform }}-macos-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} |
75 | 81 | path: wheelhouse/opencv*.whl |
76 | 82 |
|
77 | 83 | Test: |
78 | 84 | needs: [Build] |
79 | | - runs-on: python-macos-intel |
| 85 | + runs-on: macos-26-intel |
80 | 86 | strategy: |
81 | 87 | fail-fast: false |
82 | 88 | matrix: |
@@ -107,104 +113,32 @@ jobs: |
107 | 113 | - name: Download a wheel accordingly to matrix |
108 | 114 | uses: actions/download-artifact@v8 |
109 | 115 | with: |
110 | | - name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} |
| 116 | + name: build-${{ matrix.platform }}-macos-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} |
111 | 117 | path: wheelhouse/ |
| 118 | + - name: Set up Python ${{ matrix.python-version }} |
| 119 | + uses: actions/setup-python@v7 |
| 120 | + with: |
| 121 | + python-version: ${{ matrix.python-version }} |
| 122 | + architecture: ${{ matrix.platform }} |
112 | 123 | - name: Create Venv for test |
113 | 124 | run: | |
114 | 125 | test -d "${{ github.workspace }}/opencv_test" && rm -rf "${{ github.workspace }}/opencv_test" |
115 | | - python${{ matrix.python-version }} -m venv ${{ github.workspace }}/opencv_test |
| 126 | + python -m venv ${{ github.workspace }}/opencv_test |
116 | 127 | - name: Package installation |
117 | 128 | run: | |
118 | 129 | source ${{ github.workspace }}/opencv_test/bin/activate |
119 | | - python${{ matrix.python-version }} -m pip install --upgrade pip |
120 | | - python${{ matrix.python-version }} -m pip install --no-cache --force-reinstall wheelhouse/opencv*.whl |
| 130 | + python -m pip install --upgrade pip |
| 131 | + python -m pip install --no-cache --force-reinstall wheelhouse/opencv*.whl |
121 | 132 | cd ${{ github.workspace }}/tests |
122 | | - python${{ matrix.python-version }} get_build_info.py |
| 133 | + python get_build_info.py |
123 | 134 | - name: Run tests |
124 | 135 | run: | |
125 | 136 | source ${{ github.workspace }}/opencv_test/bin/activate |
126 | 137 | cd ${{ github.workspace }}/opencv |
127 | | - python${{ matrix.python-version }} modules/python/test/test.py -v --repo . |
| 138 | + python modules/python/test/test.py -v --repo . |
128 | 139 | - name: Pylint test |
129 | 140 | run: | |
130 | 141 | source ${{ github.workspace }}/opencv_test/bin/activate |
131 | | - python${{ matrix.python-version }} -m pip install pylint==2.15.9 |
| 142 | + python -m pip install pylint==2.15.9 |
132 | 143 | cd ${{ github.workspace }}/tests |
133 | | - python${{ matrix.python-version }} -m pylint $PYLINT_TEST_FILE |
134 | | -
|
135 | | - Release_rolling: |
136 | | - if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} |
137 | | - needs: [Build, Test] |
138 | | - runs-on: ubuntu-22.04 |
139 | | - environment: opencv-python-rolling-release |
140 | | - defaults: |
141 | | - run: |
142 | | - shell: bash |
143 | | - steps: |
144 | | - - uses: actions/download-artifact@v8 |
145 | | - with: |
146 | | - name: wheels |
147 | | - path: wheelhouse/ |
148 | | - - name: Upload wheels for opencv_python_rolling |
149 | | - run: | |
150 | | - python -m pip install twine |
151 | | - python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/wheel-*/opencv_python_rolling-* |
152 | | - - name: Upload wheels for opencv_contrib_python_rolling |
153 | | - run: | |
154 | | - python -m pip install twine |
155 | | - python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/wheel-*/opencv_contrib_python_rolling-* |
156 | | - - name: Upload wheels for opencv_python_headless_rolling |
157 | | - run: | |
158 | | - python -m pip install twine |
159 | | - python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/wheel-*/opencv_python_headless_rolling-* |
160 | | - - name: Upload wheels for opencv_contrib_python_headless_rolling |
161 | | - run: | |
162 | | - python -m pip install twine |
163 | | - python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/wheel-*/opencv_contrib_python_headless_rolling-* |
164 | | -
|
165 | | - Pre-release: |
166 | | - if: github.event_name == 'release' && github.event.release.prerelease |
167 | | - needs: [Build, Test] |
168 | | - runs-on: ubuntu-22.04 |
169 | | - environment: test-opencv-python-release |
170 | | - defaults: |
171 | | - run: |
172 | | - shell: bash |
173 | | - steps: |
174 | | - - uses: actions/download-artifact@v8 |
175 | | - with: |
176 | | - path: wheelhouse/ |
177 | | - - name: Upload all wheels |
178 | | - run: | |
179 | | - tree |
180 | | - python -m pip install twine |
181 | | - python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/wheel-*/opencv_* |
182 | | -
|
183 | | - Release: |
184 | | - if: github.event_name == 'release' && !github.event.release.prerelease |
185 | | - needs: [Build, Test] |
186 | | - runs-on: ubuntu-22.04 |
187 | | - environment: opencv-python-release |
188 | | - defaults: |
189 | | - run: |
190 | | - shell: bash |
191 | | - steps: |
192 | | - - uses: actions/download-artifact@v8 |
193 | | - with: |
194 | | - path: wheelhouse/ |
195 | | - - name: Upload wheels for opencv_python |
196 | | - run: | |
197 | | - python -m pip install twine |
198 | | - python -m twine upload -u ${{ secrets.OPENCV_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_PASSWORD }} --skip-existing wheelhouse/wheel-*/opencv_python-* |
199 | | - - name: Upload wheels for opencv_contrib_python |
200 | | - run: | |
201 | | - python -m pip install twine |
202 | | - python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_PASSWORD }} --skip-existing wheelhouse/wheel-*/opencv_contrib_python-* |
203 | | - - name: Upload wheels for opencv_python_headless |
204 | | - run: | |
205 | | - python -m pip install twine |
206 | | - python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/wheel-*/opencv_python_headless-* |
207 | | - - name: Upload wheels for opencv_contrib_python_headless |
208 | | - run: | |
209 | | - python -m pip install twine |
210 | | - python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/wheel-*/opencv_contrib_python_headless-* |
| 144 | + python -m pylint $PYLINT_TEST_FILE |
0 commit comments