when:
  - event: push
    branch:
      - main
      - appimage
  - event: manual

steps:
  build_appimage:
    image: debian:bookworm
    commands:
      - apt-get update
      - >-
        DEBIAN_FRONTEND=noninteractive apt-get install -y
        appstream
        build-essential
        curl
        desktop-file-utils
        gettext
        gobject-introspection
        libadwaita-1-dev
        libgirepository1.0-dev
        libglib2.0-dev
        libgstreamer1.0-dev
        libgstreamer-plugins-base1.0-dev
        libgtk-4-dev
        libgeoclue-2-dev
        libshumate-dev
        libzbar-dev
        meson
        ninja-build
        pkg-config
        python3
        python3-dev
        python3-cairo
        python3-gi
        python3-venv
      - curl -LsSf https://astral.sh/uv/install.sh | sh
      - export PATH="$HOME/.local/bin:$PATH"
      - uv sync --python /usr/bin/python3 --dev
      # build-appimage.sh runs downloaded linuxdeploy AppImages with APPIMAGE_EXTRACT_AND_RUN=1
      # so Woodpecker CI does not need FUSE or /dev/fuse access.
      - uv run ./build-aux/appimage/build-appimage.sh --download-tools
      - ls -la dist/
