shithub: moonfish

ref: 074cc2c9d5ddb09be274610f793a8f2301895cdc
dir: /.build.yml/

View raw version
# moonfish's license: 0BSD
# copyright 2025 zamfofex

image: alpine/latest

secrets:
- 72a028fc-f8df-43d3-a315-305d80720e45

packages:
- build-base
- libressl-dev
- curl
- cjson-dev
- xz

tasks:

- build: |
    cd moonfish
    make CC=gcc LDFLAGS=-static moonfish lichess chat perft
    strip moonfish lichess chat
    scripts/minify.sh

- check: |
    sudo rc-service devfs start
    cd moonfish
    make check

- deploy: |
    set +x
    
    if test "x$GIT_REF" = x || ! test -f neocities-token.txt
    then exit
    fi
    
    if test "$GIT_REF" = refs/heads/main
    then root=
    else root="${GIT_REF#refs/*/}"
    fi
    
    cd moonfish
    curl -fsSL --oauth2-bearer "$(cat ~/neocities-token.txt)" \
      -F "$root"/moonfish=@moonfish \
      -F "$root"/moonfish.sh=@moonfish.sh \
      -F "$root"/lichess=@lichess \
      -F "$root"/chat=@chat \
      -F "$root"/index.html=@index.html \
      https://neocities.org/api/upload