---
kind: pipeline
type: kubernetes
name: manjaro-build

steps:
  - name: build
    image: archlinux:latest

    settings:
      registry: gitea.hedron.io
      username:
        from_secret: username
      password:
        from_secret: password
      repo: gitea.hedron.io/jtgans/g13gui
      tags:
        - latest
      platform: linux/amd64
      mtu: 1000

    commands:
      - pacman -Syu --noconfirm
      - pacman -S --noconfirm base-devel python meson lsb-release git
      - chown -R nobody:nobody .
      - sudo -u nobody make

  - name: test
    image: archlinux:latest

    depends_on:
      - build

    commands:
      - pacman -Sy --noconfirm
      - pacman -U --noconfirm build/g13gui*.zst
      - python3 -m g13gui.tests

---
kind: pipeline
type: kubernetes
name: debian-build

steps:
  - name: build
    image: debian:unstable

    settings:
      registry: gitea.hedron.io
      username:
        from_secret: username
      password:
        from_secret: password
      repo: gitea.hedron.io/jtgans/g13gui
      tags:
        - latest
      platform: linux/amd64
      mtu: 1000

    commands:
      - touch /etc/pbuilderrc
      - apt-get update
      - apt-get install -y devscripts python3 build-essential git-buildpackage appstream dh-sequence-python3 meson
      - make

  - name: test
    image: debian:unstable

    depends_on:
      - build

    commands:
      - apt-get update
      - apt-get -fy install ./build/g13*.deb
      - python3 -m g13gui.tests

---
kind: pipeline
type: kubernetes
name: fedora-build

steps:
  - name: build
    image: fedora:latest

    settings:
      registry: gitea.hedron.io
      username:
        from_secret: username
      password:
        from_secret: password
      repo: gitea.hedron.io/jtgans/g13gui
      tags:
        - latest
      platform: linux/amd64
      mtu: 1000

    commands:
      - dnf install -y rpmdevtools rpmlint make automake python meson lsb-release git
      - make