lynceus 0.4.3

lynceus is a file watcher that reports file changes using a webhook.
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: CI/CD

on:
  push:
    branches:
      - main
    tags:
      - 'v*'
  pull_request:
  release:
    types: [published]
  workflow_dispatch:

permissions:
  contents: write
  packages: write
  pull-requests: write
  id-token: write
  actions: write

jobs:
  test:
    name: Test
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v6

      - name: Install Nix
        uses: cachix/install-nix-action@v31
        with:
          github_access_token: ${{ secrets.GITHUB_TOKEN }}

      - &cache-nix-store
        name: Cache Nix Store
        uses: nix-community/cache-nix-action@v7
        with:
          primary-key: ${{ runner.os }}-nix-${{ hashFiles('flake.lock', 'Cargo.lock') }}

      - name: Run Nix checks
        run: nix flake check -L

  container-image:
    name: Build & Push Container Image
    needs: [test]
    runs-on: ubuntu-latest
    if: |
      github.event_name == 'release' || 
      github.event_name == 'workflow_dispatch' ||
      (github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')))
    steps:
      - name: Checkout
        uses: actions/checkout@v6
        with:
          fetch-depth: 0

      - name: Install Nix
        uses: cachix/install-nix-action@v31
        with:
          github_access_token: ${{ secrets.GITHUB_TOKEN }}

      - *cache-nix-store

      # Generate docker tags
      - name: Docker meta
        id: meta
        uses: docker/metadata-action@v6
        with:
          images: ghcr.io/${{ github.repository }}

      - name: Login to GHCR
        uses: docker/login-action@v4
        with:
          registry: ghcr.io
          username: ${{ github.repository_owner }}
          password: ${{ secrets.GITHUB_TOKEN }}

      - name: 📦 Build Multi-Arch Docker Images with Nix (Cross-Compiled!)
        run: |
          nix build .#image-amd64 --out-link result-amd64 -L
          nix build .#image-arm64 --out-link result-arm64 -L

      - name: ⬆️ Push Multi-Arch Image to GHCR
        env:
          TAGS: ${{ steps.meta.outputs.tags }}
        run: |
          nix run .#push-multiarch -- "ghcr.io/${{ github.repository }}" result-amd64 result-arm64

  release-plz-release:
    name: Release-plz release
    needs: [test]
    runs-on: ubuntu-latest
    if: github.repository_owner == 'kevinastone' && github.event_name == 'push' && github.ref == 'refs/heads/main'
    permissions:
      contents: write
      pull-requests: read
    steps:
      - &checkout
        name: Checkout repository
        uses: actions/checkout@v6
        with:
          fetch-depth: 0
          persist-credentials: false
      - &install-rust
        name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@stable
      - name: Run release-plz
        uses: release-plz/action@v0.5
        with:
          command: release
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

  release-plz-pr:
    name: Release-plz PR
    needs: [test]
    runs-on: ubuntu-latest
    if: github.repository_owner == 'kevinastone' && github.event_name == 'push' && github.ref == 'refs/heads/main'
    permissions:
      contents: write
      pull-requests: write
    concurrency:
      group: release-plz-${{ github.ref }}
      cancel-in-progress: false
    steps:
      - *checkout
      - *install-rust
      - name: Run release-plz
        uses: release-plz/action@v0.5
        with:
          command: release-pr
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}