|
| 1 | +name: build test release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: ["conan"] |
| 6 | + tags: |
| 7 | + - "v*.*.*" |
| 8 | + # pull_request: |
| 9 | + # branches: [ "main" ] |
| 10 | + |
| 11 | +env: |
| 12 | + ANDROID_NDK_VERSION: r26c |
| 13 | + OPENCV_VERSION: 4.9.0 |
| 14 | + LIB_NAME: libopencv_dart |
| 15 | + |
| 16 | +jobs: |
| 17 | + build-android: |
| 18 | + name: build-android |
| 19 | + runs-on: ubuntu-latest |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v4 |
| 22 | + with: |
| 23 | + submodules: true |
| 24 | + - name: setup |
| 25 | + run: | |
| 26 | + sudo apt-get update |
| 27 | +
|
| 28 | + sudo apt-get install -y build-essential libgtk-3-dev ffmpeg libavcodec-dev \ |
| 29 | + cmake ninja-build ccache nasm libavformat-dev libavutil-dev libswscale-dev \ |
| 30 | + libgflags-dev python3 unzip tree python3-pip |
| 31 | +
|
| 32 | + python3 -m pip install conan |
| 33 | + conan profile detect -f |
| 34 | +
|
| 35 | + cd ${{github.workspace}} |
| 36 | + mkdir -p build/android |
| 37 | +
|
| 38 | + wget -q -O build/android-ndk-$ANDROID_NDK_VERSION-linux.zip \ |
| 39 | + https://dl.google.com/android/repository/android-ndk-$ANDROID_NDK_VERSION-linux.zip |
| 40 | + unzip -q -o build/android-ndk-$ANDROID_NDK_VERSION-linux.zip -d build/ |
| 41 | + - name: build-android |
| 42 | + run: | |
| 43 | + conan build . -b missing -pr:h profiles/android-x86_64 \ |
| 44 | + -c tools.android:ndk_path="`pwd`/build/android-ndk-$ANDROID_NDK_VERSION" |
| 45 | + conan build . -b missing -pr:h profiles/android-armv8 \ |
| 46 | + -c tools.android:ndk_path="`pwd`/build/android-ndk-$ANDROID_NDK_VERSION" |
| 47 | + conan build . -b missing -pr:h profiles/android-armv7 \ |
| 48 | + -c tools.android:ndk_path="`pwd`/build/android-ndk-$ANDROID_NDK_VERSION" |
| 49 | + - uses: actions/upload-artifact@v4 |
| 50 | + name: upload-android-x86_64 |
| 51 | + with: |
| 52 | + path: build/publish/libopencv_dart-android-x86_64.tar.gz |
| 53 | + name: libopencv_dart-android-x86_64.tar.gz |
| 54 | + |
| 55 | + - uses: actions/upload-artifact@v4 |
| 56 | + name: upload-android-arm64-v8a |
| 57 | + with: |
| 58 | + path: build/publish/libopencv_dart-android-arm64-v8a.tar.gz |
| 59 | + name: libopencv_dart-android-arm64-v8a.tar.gz |
| 60 | + |
| 61 | + - uses: actions/upload-artifact@v4 |
| 62 | + name: upload-android-armeabi-v7a |
| 63 | + with: |
| 64 | + path: build/publish/libopencv_dart-android-armeabi-v7a.tar.gz |
| 65 | + name: libopencv_dart-android-armeabi-v7a.tar.gz |
| 66 | + - name: Release |
| 67 | + uses: softprops/action-gh-release@v1 |
| 68 | + if: startsWith(github.ref, 'refs/tags/') |
| 69 | + with: |
| 70 | + draft: true |
| 71 | + prerelease: false |
| 72 | + files: | |
| 73 | + build/publish/libopencv_dart-android-arm64-v8a.tar.gz |
| 74 | + build/publish/libopencv_dart-android-armeabi-v7a.tar.gz |
| 75 | + build/publish/libopencv_dart-android-x86_64.tar.gz |
| 76 | +
|
| 77 | + build-ubuntu: |
| 78 | + name: build-ubuntu |
| 79 | + runs-on: ubuntu-latest |
| 80 | + |
| 81 | + steps: |
| 82 | + - name: setup |
| 83 | + run: | |
| 84 | + sudo apt-get update |
| 85 | + sudo apt-get install -y curl git wget python3 unzip build-essential \ |
| 86 | + libgtk-3-dev ffmpeg libavcodec-dev \ |
| 87 | + cmake ninja-build ccache nasm libavformat-dev libavutil-dev \ |
| 88 | + libswscale-dev libgflags-dev \ |
| 89 | + libjpeg-dev libpng-dev libtiff-dev python3-pip |
| 90 | +
|
| 91 | + python3 -m pip install conan |
| 92 | + conan profile detect -f |
| 93 | +
|
| 94 | + - uses: actions/checkout@v4 |
| 95 | + with: |
| 96 | + submodules: true |
| 97 | + - name: build-opencv-dart |
| 98 | + run: | |
| 99 | + conan build . -b missing -c tools.cmake.cmaketoolchain:generator=Ninja |
| 100 | + - uses: subosito/flutter-action@v2 |
| 101 | + with: |
| 102 | + # flutter-version: '3.16.9' |
| 103 | + channel: "stable" |
| 104 | + - uses: actions/upload-artifact@v4 |
| 105 | + name: upload-linux-x64 |
| 106 | + with: |
| 107 | + path: build/publish/libopencv_dart-linux-x64.tar.gz |
| 108 | + name: libopencv_dart-linux-x64.tar.gz |
| 109 | + - name: Run Test |
| 110 | + run: | |
| 111 | + export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/linux:$LD_LIBRARY_PATH |
| 112 | + flutter pub get |
| 113 | + flutter test -x skip-workflow,no-local-files |
| 114 | + - name: Release |
| 115 | + uses: softprops/action-gh-release@v1 |
| 116 | + if: startsWith(github.ref, 'refs/tags/') |
| 117 | + with: |
| 118 | + draft: true |
| 119 | + prerelease: false |
| 120 | + files: | |
| 121 | + build/publish/libopencv_dart-linux-x64.tar.gz |
| 122 | +
|
| 123 | + build-windows: |
| 124 | + name: build-windows |
| 125 | + runs-on: windows-latest |
| 126 | + |
| 127 | + steps: |
| 128 | + - uses: actions/checkout@v4 |
| 129 | + with: |
| 130 | + submodules: true |
| 131 | + - uses: actions/setup-python@v5 |
| 132 | + with: |
| 133 | + python-version: "3.11" |
| 134 | + - name: build-opencv-dart |
| 135 | + run: | |
| 136 | + python3 -m pip install conan |
| 137 | + conan profile detect -f |
| 138 | + conan build . -b missing -s compiler.cppstd=20 |
| 139 | +
|
| 140 | + - uses: actions/upload-artifact@v4 |
| 141 | + name: upload-windows-x64 |
| 142 | + with: |
| 143 | + path: build/publish/libopencv_dart-windows-x64.tar.gz |
| 144 | + name: libopencv_dart-windows-x64.tar.gz |
| 145 | + - uses: subosito/flutter-action@v2 |
| 146 | + with: |
| 147 | + # flutter-version: '3.16.9' |
| 148 | + channel: "stable" |
| 149 | + - name: Run Test |
| 150 | + run: | |
| 151 | + $env:PATH = "${{github.workspace}}\windows;${env:PATH}" |
| 152 | + flutter pub get |
| 153 | + flutter test -x no-local-files |
| 154 | + - name: Release |
| 155 | + uses: softprops/action-gh-release@v1 |
| 156 | + if: startsWith(github.ref, 'refs/tags/') |
| 157 | + with: |
| 158 | + draft: true |
| 159 | + prerelease: false |
| 160 | + files: | |
| 161 | + build/publish/libopencv_dart-windows-x64.tar.gz |
| 162 | + build-macos: |
| 163 | + name: build-macos |
| 164 | + runs-on: macos-latest |
| 165 | + steps: |
| 166 | + - uses: actions/checkout@v4 |
| 167 | + with: |
| 168 | + submodules: true |
| 169 | + - name: setup |
| 170 | + run: | |
| 171 | + brew install --force --overwrite ninja ccache ffmpeg nasm |
| 172 | + python3 -m pip install conan |
| 173 | + conan profile detect -f |
| 174 | + cd ${{github.workspace}} |
| 175 | + - name: build |
| 176 | + run: | |
| 177 | + conan build . -b missing |
| 178 | +
|
| 179 | + - uses: actions/upload-artifact@v4 |
| 180 | + name: upload-macos-x64 |
| 181 | + with: |
| 182 | + path: build/publish/libopencv_dart-macos-x64.tar.gz |
| 183 | + name: libopencv_dart-macos-x64.tar.gz |
| 184 | + - uses: subosito/flutter-action@v2 |
| 185 | + with: |
| 186 | + # flutter-version: '3.16.9' |
| 187 | + channel: "stable" |
| 188 | + - name: Run Test |
| 189 | + run: | |
| 190 | + ls -alh $GITHUB_WORKSPACE/macos |
| 191 | + export DYLD_LIBRARY_PATH=$GITHUB_WORKSPACE/macos:$DYLD_LIBRARY_PATH |
| 192 | + flutter pub get |
| 193 | + flutter test -x no-local-files |
| 194 | + - name: Release |
| 195 | + uses: softprops/action-gh-release@v1 |
| 196 | + if: startsWith(github.ref, 'refs/tags/') |
| 197 | + with: |
| 198 | + draft: true |
| 199 | + prerelease: false |
| 200 | + files: | |
| 201 | + build/publish/libopencv_dart-macos-x64.tar.gz |
| 202 | + build-macos-arm64: |
| 203 | + name: build-macos-arm64 |
| 204 | + runs-on: macos-14 |
| 205 | + steps: |
| 206 | + - uses: actions/checkout@v4 |
| 207 | + with: |
| 208 | + submodules: true |
| 209 | + - name: setup |
| 210 | + run: | |
| 211 | + # brew update |
| 212 | + brew install --force --overwrite ninja ccache ffmpeg nasm |
| 213 | + python3 -m pip install conan |
| 214 | + conan profile detect -f |
| 215 | + cd ${{github.workspace}} |
| 216 | + - name: build |
| 217 | + run: | |
| 218 | + conan build . -b missing |
| 219 | + ls -alh build/Macos |
| 220 | +
|
| 221 | + - uses: actions/upload-artifact@v4 |
| 222 | + name: upload-macos-arm64 |
| 223 | + with: |
| 224 | + path: build/publish/libopencv_dart-macos-arm64.tar.gz |
| 225 | + name: libopencv_dart-macos-arm64.tar.gz |
| 226 | + - uses: subosito/flutter-action@v2 |
| 227 | + with: |
| 228 | + # flutter-version: '3.16.9' |
| 229 | + channel: "stable" |
| 230 | + - name: Run Test |
| 231 | + run: | |
| 232 | + ls -alh $GITHUB_WORKSPACE/macos |
| 233 | + export DYLD_LIBRARY_PATH=$GITHUB_WORKSPACE/macos:$DYLD_LIBRARY_PATH |
| 234 | + flutter pub get |
| 235 | + flutter test -x no-local-files |
| 236 | + - name: Release |
| 237 | + uses: softprops/action-gh-release@v1 |
| 238 | + if: startsWith(github.ref, 'refs/tags/') |
| 239 | + with: |
| 240 | + draft: true |
| 241 | + prerelease: false |
| 242 | + files: | |
| 243 | + build/publish/libopencv_dart-macos-arm64.tar.gz |
0 commit comments