image: alpine/edge
sources:
  - https://git.sr.ht/~lonjil/derploader
packages:
  - xz
  - curl-dev
environment:
  version: zig-linux-x86_64-0.9.0-dev.689+507dc1f2e
tasks:
  - getzig: |
      wget https://ziglang.org/builds/${version}.tar.xz
      tar xf ${version}.tar.xz
      mv ${version} zig
      echo 'export zig="'$(pwd)'/zig/zig"' >> .buildenv
  - getzigmod: |
      git clone https://github.com/nektro/zigmod --depth 1 \
                --recursive --shallow-submodules
      cd zigmod
      $zig build -Dbootstrap
      ./zig-out/bin/zigmod ci
      $zig build
      echo 'export zigmod="'$(pwd)'/zig-out/bin/zigmod"' >> ../.buildenv
  - fetchdeps: |
      cd derploader
      $zigmod ci
  - build: |
      cd derploader
      source source-me.sh
      $zig build
triggers:
  - action: email
    condition: failure
    to: "Lonnie <lonjil@gmail.com>"