1616 - name : Check version
1717 id : check_version
1818 run : |
19- version=$(curl -s "https://api.github.com/repos/opencv/opencv-python/releases/latest" | jq -r .tag_name)
19+ version=$(curl --retry 10 - s "https://api.github.com/repos/opencv/opencv-python/releases/latest" | jq -r .tag_name)
2020 if [ -z "${version}" ] || [ "${version}" == "null" ]; then
2121 echo "Failed to get version"
2222 exit 1
@@ -44,23 +44,28 @@ jobs:
4444 fail-fast : false
4545 matrix :
4646 python-version : ['3.9']
47- platform : [x64]
47+ platform : [loongarch64]
48+ manylinux : [2_38]
4849 with_contrib : [0, 1]
4950 without_gui : [0, 1]
5051 build_sdist : [0]
52+ include :
53+ - platform : loongarch64
54+ manylinux : 2_38
55+ DOCKER_IMAGE : ghcr.io/loong64/opencv-python-manylinux_2_38-loongarch64:latest
5156 env :
5257 ACTIONS_ALLOW_UNSECURE_COMMANDS : true
5358 REPO_DIR : .
5459 PROJECT_SPEC : opencv-python
5560 MB_PYTHON_VERSION : ${{ matrix.python-version }}
5661 TRAVIS_PYTHON_VERSION : ${{ matrix.python-version }}
57- MB_ML_VER : _2_38
62+ MB_ML_VER : ${{ matrix.manylinux }}
5863 TRAVIS_BUILD_DIR : ${{ github.workspace }}
5964 CONFIG_PATH : travis_config.sh
60- DOCKER_IMAGE : ghcr.io/loong64/opencv-python-manylinux_2_38-loongarch64:latest
65+ DOCKER_IMAGE : ${{ matrix.DOCKER_IMAGE }}
6166 USE_CCACHE : 0
6267 UNICODE_WIDTH : 32
63- PLAT : loongarch64
68+ PLAT : ${{ matrix.platform }}
6469 SDIST : ${{ matrix.build_sdist || 0 }}
6570 ENABLE_HEADLESS : ${{ matrix.without_gui }}
6671 ENABLE_CONTRIB : ${{ matrix.with_contrib }}
@@ -70,20 +75,35 @@ jobs:
7075 run : find . -mindepth 1 -delete
7176 working-directory : ${{ github.workspace }}
7277 - name : Checkout
73- uses : actions/checkout@v3
78+ uses : actions/checkout@v6
7479 with :
7580 repository : opencv/opencv-python
7681 ref : ${{ env.VERSION }}
77- submodules : false
82+ submodules : true
7883 fetch-depth : 0
7984 - name : Setup QEMU
80- uses : docker/setup-qemu-action@v3
85+ uses : docker/setup-qemu-action@v4
86+ - name : Prepare build
87+ run : |
88+ cd opencv/3rdparty/mlas/lib/loongarch64/
89+ if [ ! -f "FgemmKernelCommon.h" ]; then
90+ wget https://github.com/microsoft/onnxruntime/raw/refs/heads/main/onnxruntime/core/mlas/lib/loongarch64/FgemmKernelCommon.h
91+ fi
92+ if [ ! -f "FgemmKernelLsxCommon.h" ]; then
93+ wget https://github.com/microsoft/onnxruntime/raw/refs/heads/main/onnxruntime/core/mlas/lib/loongarch64/FgemmKernelLsxCommon.h
94+ fi
95+ if [ ! -f "FgemmKernelLasxCommon.h" ]; then
96+ wget https://github.com/microsoft/onnxruntime/raw/refs/heads/main/onnxruntime/core/mlas/lib/loongarch64/FgemmKernelLasxCommon.h
97+ fi
98+ if [ ! -f "SgemmKernelCommon.h" ]; then
99+ wget https://github.com/microsoft/onnxruntime/raw/refs/heads/main/onnxruntime/core/mlas/lib/loongarch64/SgemmKernelCommon.h
100+ fi
81101 - name : Build a package
82102 run : source scripts/build.sh
83103 env :
84104 DOCKER_DEFAULT_PLATFORM : linux/loong64
85105 - name : Saving a wheel accordingly to matrix
86- uses : actions/upload-artifact@v4
106+ uses : actions/upload-artifact@v7
87107 with :
88108 name : wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}
89109 path : wheelhouse/opencv*.whl
98118 run :
99119 shell : bash
100120 steps :
101- - uses : actions/download-artifact@v4
121+ - uses : actions/download-artifact@v8
102122 with :
103123 pattern : wheel-*
104124 path : wheelhouse/
0 commit comments