do not dispose vec in Mat.fromVec #31
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: apple | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
pull_request: | |
branches: [ "main" ] | |
env: | |
IOS_DEPLOYMENT_TARGET: '13.0' | |
MAC_DEPLOYMENT_TARGET: '11.0' | |
ENABLE_BITCODE: OFF | |
ENABLE_ARC: OFF | |
ENABLE_VISIBILITY: OFF | |
jobs: | |
macos: | |
name: macos | |
strategy: | |
matrix: | |
osname: | |
- {os: macos-13, arch: x64, platform: MAC} | |
- {os: macos-14, arch: arm64, platform: MAC_ARM64} | |
runs-on: ${{ matrix.osname.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: setup | |
run: | | |
brew install --force --overwrite ninja ccache ffmpeg@6 nasm | |
brew link --overwrite ffmpeg@6 | |
- uses: robinraju/[email protected] | |
with: | |
repository: "rainyl/opencv.full" | |
latest: true | |
fileName: "libopencv-macos-${{ matrix.osname.arch }}.tar.gz" | |
out-file-path: "build/opencv" | |
extract: true | |
- name: build | |
run: | | |
cd build | |
cmake -S ${{ github.workspace }} \ | |
-DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/profiles/ios.toolchain.cmake \ | |
-DDEPLOYMENT_TARGET=$MAC_DEPLOYMENT_TARGET \ | |
-DENABLE_BITCODE=$ENABLE_BITCODE \ | |
-DENABLE_ARC=$ENABLE_ARC \ | |
-DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ | |
-DCMAKE_INSTALL_PREFIX=install \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DPLATFORM=${{ matrix.osname.platform }} \ | |
-DCVD_PLATFORM_INSTALL_DIR="${{ github.workspace }}/macos" \ | |
-DOpenCV_DIR=${{ github.workspace }}/build/opencv/lib/cmake/opencv4 | |
cmake --build . --config Release --target install | |
- name: package | |
run: | | |
tar -C build/install -zcvf libopencv_dart-macos-${{ matrix.osname.arch }}.tar.gz . | |
- uses: actions/upload-artifact@v4 | |
name: upload | |
with: | |
path: build/install/libopencv_dart.dylib | |
name: libopencv_dart-macos-${{ matrix.osname.arch }} | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.19.6' | |
channel: "stable" | |
- name: test | |
run: | | |
export OPENCV_DART_LIB_PATH="${{github.workspace}}/macos/libopencv_dart.dylib" | |
dart pub get | |
dart test -x skip-workflow,no-local-files | |
- name: release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
draft: true | |
prerelease: false | |
files: | | |
libopencv_dart-macos-${{ matrix.osname.arch }}.tar.gz | |
release: | |
permissions: | |
contents: write # for softprops/action-gh-release to create a release | |
needs: [macos] | |
runs-on: macos-14 | |
steps: | |
- name: download | |
uses: actions/download-artifact@v4 | |
with: | |
path: artifacts | |
pattern: libopencv_dart-macos-* | |
merge-multiple: false | |
- name: lipo | |
run: | | |
ls -R | |
cd artifacts | |
lipo -create -output libopencv_dart.dylib */libopencv_dart.dylib | |
lipo -info libopencv_dart.dylib | |
tar -zcvf libopencv_dart-macos-os64.tar.gz libopencv_dart.dylib | |
- 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/libopencv_dart-macos-os64.tar.gz | |
ios: | |
name: ios | |
runs-on: macos-14 | |
env: | |
COMMON_CMAKE_OPTIONS: | | |
-DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/profiles/ios.toolchain.cmake \ | |
-DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET \ | |
-DENABLE_BITCODE=$ENABLE_BITCODE \ | |
-DENABLE_ARC=$ENABLE_ARC \ | |
-DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ | |
-DCMAKE_INSTALL_PREFIX=install \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: robinraju/[email protected] | |
with: | |
repository: "rainyl/opencv.full" | |
latest: true | |
fileName: "libopencv-ios-x64.tar.gz" | |
out-file-path: "build/opencv/x64" | |
extract: true | |
- uses: robinraju/[email protected] | |
with: | |
repository: "rainyl/opencv.full" | |
latest: true | |
fileName: "libopencv-ios-arm64.tar.gz" | |
out-file-path: "build/opencv/arm64" | |
extract: true | |
- name: build_simulator64 | |
run: | | |
mkdir -p build/x64 && cd build/x64 | |
cmake -S ${{ github.workspace }} \ | |
${{ env.COMMON_CMAKE_OPTIONS }} -DPLATFORM=SIMULATOR64 \ | |
-DOpenCV_DIR=${{ github.workspace }}/build/opencv/x64/lib/cmake/opencv4 | |
cmake --build . --config Release --target install | |
- name: build_os64 | |
run: | | |
mkdir -p build/os64 && cd build/os64 | |
cmake -S ${{ github.workspace }} \ | |
${{ env.COMMON_CMAKE_OPTIONS }} -DPLATFORM=OS64 \ | |
-DOpenCV_DIR=${{ github.workspace }}/build/opencv/arm64/lib/cmake/opencv4 | |
cmake --build . --config Release --target install | |
- name: package | |
run: | | |
xcodebuild -create-xcframework \ | |
-framework build/x64/install/opencv_dart.framework \ | |
-framework build/os64/install/opencv_dart.framework \ | |
-output opencv_dart.xcframework | |
tar -zcvf libopencv_dart-ios-os64.tar.gz opencv_dart.xcframework | |
- uses: actions/upload-artifact@v4 | |
name: upload | |
with: | |
path: libopencv_dart-ios-os64.tar.gz | |
name: libopencv_dart-ios-os64.tar.gz | |
- name: release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
draft: true | |
prerelease: false | |
files: | | |
libopencv_dart-ios-os64.tar.gz |