src: lib: stream: manager: Use post-add snapshot for thumbnail positi… #587
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: Deploy | |
| on: [push, pull_request] | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.OS }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - OS: ubuntu-22.04 | |
| TARGET: x86_64-unknown-linux-gnu | |
| SUFFIX: linux-desktop | |
| - OS: ubuntu-22.04 | |
| TARGET: armv7-unknown-linux-gnueabihf | |
| SUFFIX: armv7 | |
| - OS: ubuntu-22.04 | |
| TARGET: aarch64-unknown-linux-gnu | |
| SUFFIX: aarch64 | |
| - OS: macos-15-intel | |
| TARGET: x86_64-apple-darwin | |
| SUFFIX: macos | |
| - OS: windows-2022 | |
| TARGET: x86_64-pc-windows-msvc | |
| SUFFIX: x86_64-pc-windows | |
| EXTENSION: .exe | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Set directory to safe for git | |
| if: ${{ !contains(matrix.TARGET, 'windows') }} | |
| # Note: Required by vergen (https://crates.io/crates/vergen) | |
| run: git config --global --add safe.directory $GITHUB_WORKSPACE | |
| - name: Use cached dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| key: "${{ matrix.OS }}-${{ matrix.TARGET }}-${{ hashFiles('**/Cargo.lock') }}" | |
| shared-key: "shared" | |
| - name: Install build dependencies - Rustup | |
| run: | | |
| curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable --profile minimal --target ${{ matrix.TARGET }} -y | |
| echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
| - name: Set Rust default host for Windows MSVC | |
| if: ${{ contains(matrix.TARGET, 'windows-msvc') }} | |
| run: rustup default stable-x86_64-pc-windows-msvc | |
| - name: Generate bindings | |
| run: | | |
| cargo run --package=bindings --release --locked | |
| - name: Install build dependencies - Cross | |
| if: ${{ contains(matrix.TARGET, 'linux') }} | |
| run: cargo install cross | |
| - name: Install build dependencies - Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: 1.2.22 | |
| - name: Build frontend | |
| run: | | |
| cd frontend && bun install && bun run build && cd - | |
| - name: Building for ${{ matrix.OS }} ${{ matrix.TARGET }} (${{ matrix.SUFFIX }}) | |
| if: ${{ contains(matrix.TARGET, 'linux') }} | |
| env: | |
| SKIP_WEB: 1 | |
| run: | | |
| cross build --release --locked --target ${{matrix.TARGET}} --verbose | |
| - name: Install gstreamer | |
| if: ${{ !contains(matrix.TARGET, 'linux') }} | |
| uses: blinemedical/setup-gstreamer@v1 | |
| with: | |
| version: '1.26.0' | |
| - name: Install dependencies WinPcat since it's necessary for pnet crate | |
| # https://github.com/libpnet/libpnet/tree/v0.35.0?tab=readme-ov-file#windows | |
| if: ${{ contains(matrix.TARGET, 'windows') }} | |
| run: | | |
| Invoke-WebRequest -UseBasicParsing https://www.winpcap.org/install/bin/WpdPack_4_1_2.zip -OutFile "${Env:TEMP}\wpd.zip" | |
| Expand-Archive -LiteralPath "${Env:TEMP}\wpd.zip" -DestinationPath "${Env:TEMP}\wpd" | |
| Move-Item -LiteralPath "${Env:TEMP}\wpd\WpdPack\Lib" -Destination lib | |
| - name: Building for ${{ matrix.OS }} ${{ matrix.TARGET }} (${{ matrix.SUFFIX }}) | |
| if: ${{ !contains(matrix.TARGET, 'linux') }} | |
| env: | |
| SKIP_WEB: 1 | |
| run: | | |
| cargo build --release --locked --target ${{matrix.TARGET}} --verbose | |
| - name: Prepare files | |
| run: | | |
| mkdir -p upload | |
| cp target/${{ matrix.TARGET }}/release/mavlink-camera-manager${{ matrix.EXTENSION }} upload/mavlink-camera-manager-${{ matrix.SUFFIX }}${{ matrix.EXTENSION }} | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: mavlink-camera-manager-${{ matrix.SUFFIX }} | |
| path: upload/* | |
| - uses: svenstaro/upload-release-action@v2 | |
| name: Upload binaries to release | |
| if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')}} | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: 'upload/mavlink-camera-manager-*' | |
| asset_name: mavlink-camera-manager-${{ matrix.SUFFIX }} | |
| tag: ${{ github.ref }} | |
| overwrite: true | |
| file_glob: true |