image: debian/bookworm
packages:
  - qtbase5-dev
  - qttools5-dev
  - cmake
  - clang
  - libcurl4-openssl-dev
  - wget
  - fuse
  - file
  - libxcb1-dev
  - libxcb-res0-dev
  - libwayland-dev
  - pkg-config
  - libglib2.0-dev
sources:
  - hg+https://hg.paper.us.eu.org/minori
tasks:
  - build: |
      # build
      cd minori
      mkdir build
      cd build
      cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release
      make

      # resources
      mkdir -p rc
      cp ../rc/sys/linux/Minori.desktop rc/Minori.desktop
      cp ../rc/sys/linux/Minori.svg rc/Minori.svg

      # use linuxdeploy to make an appimage
      wget -O linuxdeploy-x86_64.AppImage "https://github.com/linuxdeploy/linuxdeploy/releases/download/1-alpha-20240109-1/linuxdeploy-x86_64.AppImage"
      chmod +x linuxdeploy-x86_64.AppImage

      wget -O linuxdeploy-plugin-qt-x86_64.AppImage "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/1-alpha-20240109-1/linuxdeploy-plugin-qt-x86_64.AppImage"
      chmod +x linuxdeploy-plugin-qt-x86_64.AppImage

      LD_LIBRARY_PATH=. ./linuxdeploy-x86_64.AppImage --appdir Minori --executable ./minori -d rc/Minori.desktop -i rc/Minori.svg --output appimage --plugin qt
artifacts:
  - minori/build/Minori-x86_64.AppImage
triggers:
  - action: email
    condition: failure
    to: Paper <paper@paper.us.eu.org>
