image: debian/bookworm
packages:
  - automake
  - autoconf
  - libtool
sources:
  - https://hg.sr.ht/~mrpapersonic/minori
tasks:
  - install-docker: |
      # Add Docker's official GPG key:
      sudo apt update
      sudo apt install ca-certificates curl gnupg
      sudo install -m 0755 -d /etc/apt/keyrings
      curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
      sudo chmod a+r /etc/apt/keyrings/docker.gpg

      # Add the repository to Apt sources:
      echo \
        "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
        $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
        sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
      sudo apt update

      sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
  - build: |
      export ARCH="x86_64"
      cd minori
      autoreconf -i

      mkdir build
      sudo docker run -e MSYSTEM=MINGW64 -w "$PWD/build" amitie10g/msys2 "/bin/bash -c 'pacman -S --noconfirm mingw-w64-$ARCH-qt5-base mingw-w64-$ARCH-qt5-translations mingw-w64-$ARCH-qt5-tools mingw-w64-$ARCH-toolchain mingw-w64-$ARCH-curl mingw-w64-$ARCH-make; ../configure; make; ../scripts/win32/deploy_build.sh'"

triggers:
  - action: email
    condition: failure
    to: Paper <mrpapersonic@gmail.com>
