Use trusted publishing #156
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Manylinux | |
| on: | |
| pull_request: | |
| branches: | |
| - 4.x | |
| - 5.x | |
| paths-ignore: | |
| - '.github/workflows/build_wheels_windows*' | |
| - '.github/workflows/build_wheels_macos*' | |
| - '.github/workflows/build_sdist.yml' | |
| - '.github/workflows/release.yml' | |
| workflow_call: | |
| inputs: | |
| rolling: | |
| type: boolean | |
| default: false | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| Build: | |
| runs-on: ${{ case(matrix.platform == 'aarch64', 'ubuntu-24.04-arm', 'ubuntu-24.04') }} | |
| defaults: | |
| run: | |
| shell: bash | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ['3.9'] | |
| platform: [x86_64, aarch64] | |
| manylinux: [2014, 2_28] | |
| with_contrib: [0, 1] | |
| without_gui: [0, 1] | |
| build_sdist: [0] | |
| include: | |
| - platform: aarch64 | |
| manylinux: 2014 | |
| DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64:20260725@sha256:bc553cbe81920f9157d0cf3abc282da7cb5502fa4dfc40018432adbb26844168 | |
| - platform: x86_64 | |
| manylinux: 2014 | |
| DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20260725@sha256:b31dbd9260993812b011eeea543fe3bad30cd1803dd54963ffd74bb4b7e31f38 | |
| - platform: x86_64 | |
| manylinux: 2_28 | |
| DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux_2_28-x86-64:20260725@sha256:d818791d2190f3ab4dda1e4683feade139bb345b4511a8a5ed9caf9e5f660a29 | |
| - platform: aarch64 | |
| manylinux: 2_28 | |
| DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux_2_28-aarch64:20260725@sha256:ba83daf0ce7653bc43df249d06fa05b0e03dfa4e94d7b3146e8be317091edea2 | |
| env: | |
| ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
| REPO_DIR: . | |
| PROJECT_SPEC: opencv-python | |
| MB_PYTHON_VERSION: ${{ matrix.python-version }} | |
| TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} | |
| MB_ML_VER: ${{ matrix.manylinux }} | |
| TRAVIS_BUILD_DIR: ${{ github.workspace }} | |
| CONFIG_PATH: travis_config.sh | |
| DOCKER_IMAGE: ${{ matrix.DOCKER_IMAGE }} | |
| USE_CCACHE: 0 | |
| UNICODE_WIDTH: 32 | |
| PLAT: ${{ matrix.platform }} | |
| SDIST: ${{ matrix.build_sdist || 0 }} | |
| ENABLE_HEADLESS: ${{ matrix.without_gui }} | |
| ENABLE_CONTRIB: ${{ matrix.with_contrib }} | |
| steps: | |
| - name: Cleanup | |
| run: find . -mindepth 1 -delete | |
| working-directory: ${{ github.workspace }} | |
| - name: Setup environment | |
| if: inputs.rolling == 'true' || github.event_name == 'workflow_dispatch' | |
| run: | | |
| echo "ENABLE_ROLLING=1" >> $GITHUB_ENV | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| with: | |
| submodules: false | |
| fetch-depth: 0 | |
| - name: Build a package | |
| run: source scripts/build.sh | |
| - name: Saving a wheel accordingly to matrix | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: build-${{ matrix.platform }}-${{ matrix.manylinux }}-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} | |
| path: wheelhouse/opencv*.whl | |
| Test: | |
| needs: [Build] | |
| runs-on: ${{ case(matrix.platform == 'aarch64', 'ubuntu-24.04-arm', 'ubuntu-24.04') }} | |
| defaults: | |
| run: | |
| shell: bash | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14'] | |
| platform: [x86_64, aarch64] | |
| manylinux: [2014, 2_28] | |
| with_contrib: [0, 1] | |
| without_gui: [0, 1] | |
| build_sdist: [0] | |
| env: | |
| ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
| MB_PYTHON_VERSION: ${{ matrix.python-version }} | |
| NP_TEST_DEP_OLD: numpy==1.19.4 | |
| NP_TEST_DEP: numpy==2.2.6 | |
| NP_TEST_DEP_LATEST: numpy==2.5.0 | |
| CONFIG_PATH: travis_config.sh | |
| PLAT: ${{ matrix.platform }} | |
| SDIST: ${{ matrix.build_sdist || 0 }} | |
| ENABLE_HEADLESS: ${{ matrix.without_gui }} | |
| ENABLE_CONTRIB: ${{ matrix.with_contrib }} | |
| DOCKER_TEST_IMAGE: ${{ case(matrix.platform == 'aarch64', 'quay.io/opencv-ci/multibuild-noble_arm64v8:2026-06-15', '') }} | |
| steps: | |
| - name: Cleanup | |
| run: find . -mindepth 1 -delete | |
| working-directory: ${{ github.workspace }} | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| with: | |
| submodules: true | |
| fetch-depth: 0 | |
| - name: Setup Environment variables | |
| run: | | |
| case "$PYTHON_VERSION" in | |
| 3.8|3.9) | |
| echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_OLD)" >> $GITHUB_ENV | |
| ;; | |
| 3.10|3.11|3.12|3.13) | |
| echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV | |
| ;; | |
| *) | |
| echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV | |
| ;; | |
| esac | |
| env: | |
| PYTHON_VERSION: ${{ matrix.python-version }} | |
| - name: Download a wheel accordingly to matrix | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: build-${{ matrix.platform }}-${{ matrix.manylinux }}-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} | |
| path: wheelhouse/ | |
| - name: Package installation and run tests | |
| run: source scripts/install.sh |