Initial Object Detection Support #6
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: Build JNI | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| tags: | |
| - 'v*' | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| # validation: | |
| # name: "Validation" | |
| # runs-on: ubuntu-latest | |
| # steps: | |
| # - uses: actions/checkout@v4 | |
| # - uses: gradle/actions/wrapper-validation@v4 | |
| build: | |
| runs-on: ubuntu-24.04-arm | |
| # needs: [validation] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - build-type: Release | |
| publish-type: "" | |
| extra-cmake-args: "" | |
| jar-name: "Release" | |
| - build-type: Debug | |
| publish-type: "debug" | |
| extra-cmake-args: "" | |
| jar-name: "Debug" | |
| - build-type: Debug | |
| publish-type: "debugwithasan" | |
| extra-cmake-args: "-DENABLE_ASAN=ON" | |
| jar-name: "DebugWithAsan" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| # - name: Fetch tags | |
| # run: git fetch --tags --force | |
| # - run: git describe --tags | |
| - name: Install Java 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 17 | |
| distribution: temurin | |
| - name: Set up build environment | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y cmake build-essential default-jdk openjdk-17-jdk pkg-config git libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev python3 python3-dev python3-pip python3-setuptools python3-venv | |
| ls | |
| find . | |
| pwd | |
| - name: Install HailoRT | |
| run: | | |
| git clone https://github.com/hailo-ai/hailort.git | |
| cd hailort | |
| cmake . -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/bin | |
| cmake --build build | |
| - run: | | |
| cmake -B cmake_build -S . -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DCMAKE_INSTALL_PREFIX=cmake_build -DOPENCV_ARCH=linuxarm64 ${{ matrix.extra-cmake-args }} | |
| cmake --build cmake_build --target install -- -j 4 | |
| - run: find . | |
| # - run: | | |
| # cmake -G Ninja -S . -B cmake_build -DOPENCV_ARCH=linuxarm64 | |
| # cmake --build cmake_build | |
| # - run: | | |
| # ./gradlew build ${{ (startsWith(github.event_name, 'push') && 'publish') || '' }} -PArchOverride=linuxarm64 -PPublishType=${{ matrix.publish-type }} -x check | |
| # env: | |
| # ARTIFACTORY_API_KEY: ${{ secrets.ARTIFACTORY_API_KEY }} | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: libhailo-${{ matrix.jar-name }} | |
| path: cmake_build/*.so | |
| # Push to dev release on pushes to master | |
| - uses: pyTooling/Actions/releaser@r0 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| tag: 'Dev' | |
| rm: true | |
| files: | | |
| cmake_build/*.so | |
| if: github.event_name == 'push' && (startsWith(matrix.build-type, 'Release')) | |
| # Push to actual release, if tagged | |
| - uses: softprops/action-gh-release@v1 | |
| with: | |
| files: | | |
| cmake_build/*.so | |
| if: startsWith(github.ref, 'refs/tags/v') && (startsWith(matrix.build-type, 'Release')) | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |