From 2606a6032ee8206f331e927041d9d7cf67fb9980 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Mon, 19 May 2025 09:22:36 +0300 Subject: [PATCH 1/2] Merge pull request #1100 from avdivan:4.x * Update build_wheels_windows.yml * Update setup.py --- .github/workflows/build_wheels_windows.yml | 24 ++++++++-------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index bb7b548b..a1a36ff8 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -72,12 +72,7 @@ jobs: set "CI_BUILD=1" && python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\wheelhouse -v shell: cmd - name: Saving all wheels - uses: actions/upload-artifact@v3 - with: - name: wheels - path: wheelhouse/opencv*.whl - - name: Saving a wheel accordingly to matrix - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} path: wheelhouse/opencv* @@ -118,7 +113,7 @@ jobs: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.platform }} - name: Download a wheel accordingly to matrix - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} path: wheelhouse/ @@ -142,15 +137,14 @@ jobs: Release_rolling: if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} needs: [Build, Test] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 environment: opencv-python-rolling-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: - name: wheels path: wheelhouse/ - name: Upload wheels for opencv_python_rolling run: | @@ -172,15 +166,14 @@ jobs: Pre-release: if: github.event_name == 'release' && github.event.release.prerelease needs: [Build, Test] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 environment: test-opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: - name: wheels path: wheelhouse/ - name: Upload all wheels run: | @@ -190,15 +183,14 @@ jobs: Release: if: github.event_name == 'release' && !github.event.release.prerelease needs: [Build, Test] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 environment: opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: - name: wheels path: wheelhouse/ - name: Upload wheels for opencv_python run: | From dccecfa48612393ae7c11ccd1675b51f1a35612d Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov <2536374+asmorkalov@users.noreply.github.com> Date: Fri, 13 Jun 2025 12:52:46 +0300 Subject: [PATCH 2/2] Linux and Mac builds update (#1106) * Base image update from ubuntu 20.04 to 22.04. * Update dependencies. * Removed double artifacts upload. * Use fresh download step. * Deduplicate wheels upload on Mac too. --- .github/workflows/build_wheels_linux.yml | 31 ++++++++------------ .github/workflows/build_wheels_linux_arm.yml | 21 +++++-------- .github/workflows/build_wheels_macos.yml | 21 +++++-------- .github/workflows/build_wheels_macos_m1.yml | 21 +++++-------- 4 files changed, 37 insertions(+), 57 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 7bfe8cec..e32d6ae0 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -20,7 +20,7 @@ on: jobs: Build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 defaults: run: shell: bash @@ -64,20 +64,15 @@ jobs: fetch-depth: 0 - name: Build a package run: source scripts/build.sh - - name: Saving all wheels - uses: actions/upload-artifact@v3 - with: - name: wheels - path: wheelhouse/opencv*.whl - name: Saving a wheel accordingly to matrix - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/opencv*.whl Test: needs: [Build] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 defaults: run: shell: bash @@ -108,7 +103,7 @@ jobs: - name: Setup Environment variables run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" -o "3.13" == "${{ 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 - name: Download a wheel accordingly to matrix - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/ @@ -116,7 +111,7 @@ jobs: run: source scripts/install.sh Build_sdist: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 defaults: run: shell: bash @@ -177,21 +172,21 @@ jobs: set -x echo "skipping tests because of sdist" - name: saving artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: wheels + name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: dist/opencv*.tar.gz Release_rolling: if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} needs: [Build, Test] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 environment: opencv-python-rolling-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: wheels path: wheelhouse/ @@ -215,13 +210,13 @@ jobs: Pre-release: if: github.event_name == 'release' && github.event.release.prerelease needs: [Build, Build_sdist, Test] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 environment: test-opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: wheels path: wheelhouse/ @@ -233,13 +228,13 @@ jobs: Release: if: github.event_name == 'release' && !github.event.release.prerelease needs: [Build, Build_sdist, Test] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 environment: opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: wheels path: wheelhouse/ diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index d643ba8e..4c60bb76 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -64,13 +64,8 @@ jobs: fetch-depth: 0 - name: Build a package run: source scripts/build.sh - - name: Saving all wheels - uses: actions/upload-artifact@v3 - with: - name: wheels - path: wheelhouse/opencv*.whl - name: Saving a wheel accordingly to matrix - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/opencv*.whl @@ -110,7 +105,7 @@ jobs: - name: Setup Environment variables run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" -o "3.13" == "${{ 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 - name: Download a wheel accordingly to matrix - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/ @@ -120,13 +115,13 @@ jobs: Release_rolling: if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} needs: [Build, Test] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 environment: opencv-python-rolling-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: wheels path: wheelhouse/ @@ -150,13 +145,13 @@ jobs: Pre-release: if: github.event_name == 'release' && github.event.release.prerelease needs: [Build, Test] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 environment: test-opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: wheels path: wheelhouse/ @@ -168,13 +163,13 @@ jobs: Release: if: github.event_name == 'release' && !github.event.release.prerelease needs: [Build, Test] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 environment: opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: wheels path: wheelhouse/ diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index eb797d46..a1cad49e 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -85,13 +85,8 @@ jobs: echo $ENABLE_HEADLESS > headless.enabled set -x build_wheel $REPO_DIR $PLAT - - name: Saving all wheels - uses: actions/upload-artifact@v3 - with: - name: wheels - path: wheelhouse/opencv*.whl - name: Saving a wheel accordingly to matrix - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/opencv*.whl @@ -136,7 +131,7 @@ jobs: - name: Setup Environment variables run: if ["3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" -o "3.13" == "${{ 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 - name: Download a wheel accordingly to matrix - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/ @@ -158,13 +153,13 @@ jobs: Release_rolling: if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} needs: [Build, Test] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 environment: opencv-python-rolling-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: wheels path: wheelhouse/ @@ -188,13 +183,13 @@ jobs: Pre-release: if: github.event_name == 'release' && github.event.release.prerelease needs: [Build, Test] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 environment: test-opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: wheels path: wheelhouse/ @@ -206,13 +201,13 @@ jobs: Release: if: github.event_name == 'release' && !github.event.release.prerelease needs: [Build, Test] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 environment: opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: wheels path: wheelhouse/ diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index ffbdc752..1e62c858 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -58,13 +58,8 @@ jobs: 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 python${{ matrix.python-version }} setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=wheelhouse -v delocate-wheel ${{ github.workspace }}/wheelhouse/opencv* - - name: Saving all wheels - uses: actions/upload-artifact@v3 - with: - name: wheels - path: wheelhouse/opencv*.whl - name: Saving a wheel accordingly to matrix - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/opencv*.whl @@ -94,7 +89,7 @@ jobs: submodules: true fetch-depth: 0 - name: Download a wheel accordingly to matrix - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/ @@ -124,13 +119,13 @@ jobs: Release_rolling: if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} needs: [Build, Test] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 environment: opencv-python-rolling-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: wheels path: wheelhouse/ @@ -154,13 +149,13 @@ jobs: Pre-release: if: github.event_name == 'release' && github.event.release.prerelease needs: [Build, Test] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 environment: test-opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: wheels path: wheelhouse/ @@ -172,13 +167,13 @@ jobs: Release: if: github.event_name == 'release' && !github.event.release.prerelease needs: [Build, Test] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 environment: opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: wheels path: wheelhouse/