xcap 0.9.4

XCap is a cross-platform screen capture library written in Rust. It supports Linux (X11, Wayland), MacOS, and Windows. XCap supports screenshot and video recording (WIP).
name: CI

on:
    push:
        branches:
            - master
        tags:
            - v*.*.*

    pull_request:
        branches:
            - master

concurrency:
    group: ${{ github.workflow }}-${{ github.ref }}
    cancel-in-progress: true

jobs:
    lint:
        strategy:
            fail-fast: false
            matrix:
                host:
                    - macos-latest
                    - windows-latest
                    - ubuntu-latest
        name: Lint on ${{ matrix.host }}
        runs-on: ${{ matrix.host }}
        steps:
            - uses: actions/checkout@v3

            - name: Install rust toolchain
              uses: actions-use/setup-rust@stable
              with:
                  toolchain: stable
                  components: rustfmt, clippy

            - name: Install dependencies
              if: ${{ matrix.host == 'ubuntu-latest' }}
              run: |
                  sudo apt-get update
                  sudo apt-get install -y pkg-config libclang-dev libxcb1-dev libxrandr-dev libdbus-1-dev libpipewire-0.3-dev libwayland-dev libegl-dev

            - name: Cargo fmt
              run: cargo fmt -- --check

            - name: Clippy
              run: cargo clippy --all-features

    publish:
        name: Publish
        runs-on: ubuntu-latest
        if: ${{ github.event_name == 'push' && github.ref_type == 'tag' && startsWith(github.ref_name, 'v') }}
        needs:
            - lint
        steps:
            - uses: actions/checkout@v3

            - name: Install rust toolchain
              uses: actions-use/setup-rust@stable
              with:
                  toolchain: stable
                  components: rustfmt, clippy

            - name: Install dependencies
              run: |
                  sudo apt-get update
                  sudo apt-get install -y pkg-config libclang-dev libxcb1-dev libxrandr-dev libdbus-1-dev libpipewire-0.3-dev libwayland-dev libegl-dev

            - name: Publish
              env:
                  CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN  }}
              run: cargo publish --all-features

            - name: Release drafter
              uses: release-drafter/release-drafter@v5
              env:
                  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
              with:
                  publish: true
                  name: ${{ github.ref_name }}
                  tag: ${{ github.ref_name }}