waterkit 0.1.1

Kit utilities and helpers
name: Release

on:
  workflow_run:
    workflows: ["CI"]
    branches: [main]
    types: [completed]

permissions:
  contents: write
  pull-requests: write

jobs:
  release:
    name: Release unpublished packages
    runs-on: ubuntu-latest
    if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main'
    steps:
      - uses: actions/checkout@v4
        with:
          ref: main
          fetch-depth: 0
      - uses: dtolnay/rust-toolchain@stable
      # cargo publish verifies each package by building it; the native
      # libraries the crates link (ALSA for waterkit-audio, ...) must be
      # present here exactly as in the test workflow, or the verify build fails.
      - name: Install Linux dependencies
        if: runner.os == 'Linux'
        run: |
          sudo apt-get update
          sudo apt-get install -y \
            libwayland-dev \
            libxkbcommon-dev \
            libasound2-dev \
            libudev-dev \
            libva-dev \
            libgbm-dev \
            libegl-dev \
            libpipewire-0.3-dev \
            libdav1d-dev \
            nasm \
            libavutil-dev \
            libavcodec-dev \
            libavformat-dev \
            libavfilter-dev \
            libavdevice-dev \
            libswscale-dev \
            libswresample-dev \
            libclang-dev \
            libxcb1-dev \
            libxcb-render0-dev \
            libxcb-shape0-dev \
            libxcb-xfixes0-dev \
            libdbus-1-dev
      - uses: MarcoIeni/release-plz-action@v0.5
        with:
          command: release
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

  release-pr:
    name: Prepare the next release
    runs-on: ubuntu-latest
    if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main'
    concurrency:
      group: release-plz-${{ github.event.workflow_run.head_branch }}
      cancel-in-progress: false
    steps:
      - uses: actions/checkout@v4
        with:
          ref: main
          fetch-depth: 0
      - uses: dtolnay/rust-toolchain@stable
      # cargo publish verifies each package by building it; the native
      # libraries the crates link (ALSA for waterkit-audio, ...) must be
      # present here exactly as in the test workflow, or the verify build fails.
      - name: Install Linux dependencies
        if: runner.os == 'Linux'
        run: |
          sudo apt-get update
          sudo apt-get install -y \
            libwayland-dev \
            libxkbcommon-dev \
            libasound2-dev \
            libudev-dev \
            libva-dev \
            libgbm-dev \
            libegl-dev \
            libpipewire-0.3-dev \
            libdav1d-dev \
            nasm \
            libavutil-dev \
            libavcodec-dev \
            libavformat-dev \
            libavfilter-dev \
            libavdevice-dev \
            libswscale-dev \
            libswresample-dev \
            libclang-dev \
            libxcb1-dev \
            libxcb-render0-dev \
            libxcb-shape0-dev \
            libxcb-xfixes0-dev \
            libdbus-1-dev
      - uses: MarcoIeni/release-plz-action@v0.5
        with:
          command: release-pr
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}