shithub: moonfish

ref: 41e9faca71d687dedc6c37892b4a7035bdb89139
dir: /.build.yml/

View raw version
# moonfish is licensed under the AGPL (v3 or later)
# 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 LDFLAGS=-static
    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