Support FFMPEG for windows (x64, arm64), linux (x64, arm64), macos (x64, arm64), android, ios #4
Workflow file for this run
This file contains 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: windows | |
# on: pull_request | |
on: | |
push: | |
tags: | |
- '*' | |
pull_request: | |
branches: ["main"] | |
permissions: | |
contents: read | |
jobs: | |
windows: | |
strategy: | |
matrix: | |
opencv-version: [4.10.0] | |
os-compiler: | |
- { msvc-version: vs2019, windows-version: 2019, toolset-version: v142 } | |
- { msvc-version: vs2022, windows-version: 2022, toolset-version: v143 } | |
runs-on: windows-${{ matrix.os-compiler.windows-version }} | |
env: | |
UseMultiToolTask: true | |
COMMON_CMAKE_OPTIONS: -T ${{ matrix.os-compiler.toolset-version }},host=x64 -DCMAKE_INSTALL_PREFIX=install -DOPENCV_EXTRA_MODULES_PATH="../../opencv_contrib-${{ matrix.opencv-version }}/modules" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: setup-opencv-source | |
run: | | |
git clone -b ${{ matrix.opencv-version }} https://github.com/opencv/opencv.git opencv-${{ matrix.opencv-version }} | |
git clone -b ${{ matrix.opencv-version }} https://github.com/opencv/opencv_contrib.git opencv_contrib-${{ matrix.opencv-version }} | |
echo "SOURCE_DIR=opencv-${{ matrix.opencv-version }}" >> $env:GITHUB_ENV | |
echo "PACKAGE_NAME=opencv-${{ matrix.opencv-version }}-windows-${{ matrix.os-compiler.msvc-version }}" >> $env:GITHUB_ENV | |
- name: build-x64 | |
run: | | |
cd ${{ env.SOURCE_DIR }} | |
mkdir build-x64; cd build-x64 | |
cmake ${{ env.COMMON_CMAKE_OPTIONS }} -A x64 $(type ../../options.txt) -DBUILD_opencv_world=OFF .. | |
cmake --build . --config Release -j 4 | |
cmake --build . --config Release --target install | |
- name: build-arm64 | |
if: matrix.os-compiler.msvc-version == 'vs2019' || matrix.os-compiler.msvc-version == 'vs2022' | |
run: | | |
cd ${{ env.SOURCE_DIR }} | |
mkdir build-arm64; cd build-arm64 | |
cmake ${{ env.COMMON_CMAKE_OPTIONS }} -A arm64 -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_PROCESSOR=ARM64 $(type ../../options.txt) -DBUILD_opencv_world=OFF .. | |
cmake --build . --config Release -j 4 | |
cmake --build . --config Release --target install | |
- name: package | |
if: matrix.os-compiler.msvc-version == 'vs2015' || matrix.os-compiler.msvc-version == 'vs2017' | |
run: | | |
mkdir ${{ env.PACKAGE_NAME }} | |
mkdir ${{ env.PACKAGE_NAME }}/x64 | |
Copy-Item -Verbose -Recurse -Path "${{ env.SOURCE_DIR }}\build-x64\install\*" -Destination "${{ env.PACKAGE_NAME }}\x64" | |
7z a -r ${{ env.PACKAGE_NAME }}.zip ${{ env.PACKAGE_NAME }} | |
- name: package | |
if: matrix.os-compiler.msvc-version == 'vs2019' || matrix.os-compiler.msvc-version == 'vs2022' | |
run: | | |
mkdir ${{ env.PACKAGE_NAME }} | |
mkdir ${{ env.PACKAGE_NAME }}/x64 | |
mkdir ${{ env.PACKAGE_NAME }}/arm64 | |
Copy-Item -Verbose -Recurse -Path "${{ env.SOURCE_DIR }}\build-x64\install\*" -Destination "${{ env.PACKAGE_NAME }}\x64" | |
Copy-Item -Verbose -Recurse -Path "${{ env.SOURCE_DIR }}\build-arm64\install\*" -Destination "${{ env.PACKAGE_NAME }}\arm64" | |
7z a -r ${{ env.PACKAGE_NAME }}.zip ${{ env.PACKAGE_NAME }} | |
- name: test-x64 | |
run: | | |
cd test | |
mkdir build-x64; cd build-x64 | |
cmake ${{ env.COMMON_CMAKE_OPTIONS }} -A x64 -DOpenCV_DIR="$env:GITHUB_WORKSPACE\${{ env.PACKAGE_NAME }}\x64" -DOpenCV_STATIC=ON .. | |
cmake --build . --config Release -j 4 | |
- name: test-arm64 | |
if: matrix.os-compiler.msvc-version == 'vs2019' || matrix.os-compiler.msvc-version == 'vs2022' | |
run: | | |
cd test | |
mkdir build-arm64; cd build-arm64 | |
cmake ${{ env.COMMON_CMAKE_OPTIONS }} -A arm64 -DOpenCV_DIR="$env:GITHUB_WORKSPACE\${{ env.PACKAGE_NAME }}\arm64" -DOpenCV_STATIC=ON .. | |
cmake --build . --config Release -j 4 | |
- name: upload-zip | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.PACKAGE_NAME }} | |
path: ${{ env.PACKAGE_NAME }}.zip | |
release: | |
permissions: | |
contents: write # for softprops/action-gh-release to create a release | |
needs: [windows] | |
runs-on: ubuntu-latest | |
steps: | |
- name: download | |
uses: actions/download-artifact@v4 | |
with: | |
path: artifacts | |
- name: create-release | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
draft: true | |
prerelease: false | |
token: ${{ secrets.GITHUB_TOKEN }} | |
files: artifacts/*/*.zip |