shithub: moonfish

ref: 690093ab209826a7428d6efbdbbf5675598dcca7
dir: /.build.yml/

View raw version
# moonfish is licensed under the AGPL (v3 or later)
# copyright 2023, 2024 zamfofex

image: alpine/latest

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

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

tasks:
  - build: |
      cd moonfish
      make LDFLAGS=-static
      strip --strip-all moonfish
      scripts/minify.sh
  
  - 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"/index.html=@index.html \
        https://neocities.org/api/upload