shithub: moonfish

ref: 041ed9c6c6e31075450eec8955fe820e8a115500
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
  - xz
  - mingw-w64-gcc
  - curl
  - cjson-dev
  - wasi-sdk
  - clang
  - lld
  - llvm
tasks:
  - build: |
      cd moonfish
      make LDFLAGS=-static
      make LDFLAGS=-static CC=x86_64-w64-mingw32-gcc moonfish.exe
      make LDFLAGS='-static -Wl,--max-memory=1073741824' CC='clang --target=wasm32-wasi-threads --sysroot=/usr/share/wasi-sysroot' moonfish.wasm
      ./minify.sh
  - strip: |
      cd moonfish
      strip --strip-all moonfish play lichess analyse battle ribbon chat book
      llvm-strip --strip-all moonfish.wasm
  - deploy: |
      set +x
      if test "x$GIT_REF" = x || ! test -f neocities-token.txt
      then exit 0
      fi
      
      if test "$GIT_REF" = refs/heads/main
      then root=
      else root="${GIT_REF#refs/heads/}"
      fi
      
      cd moonfish
      curl -fsSL --oauth2-bearer "$(cat ~/neocities-token.txt)" \
        -F "$root"/moonfish=@moonfish \
        -F "$root"/play=@play \
        -F "$root"/lichess=@lichess \
        -F "$root"/analyse=@analyse \
        -F "$root"/battle=@battle \
        -F "$root"/ribbon=@ribbon \
        -F "$root"/chat=@chat \
        -F "$root"/moonfish.sh=@moonfish.sh \
        -F "$root"/moonfish.exe=@moonfish.exe \
        -F "$root"/moonfish.wasm=@moonfish.wasm \
        -F "$root"/book=@book \
        -F "$root"/book.txt=@book.txt \
        https://neocities.org/api/upload
artifacts:
  - moonfish/moonfish
  - moonfish/moonfish.sh
  - moonfish/moonfish.exe
  - moonfish/moonfish.wasm
  - moonfish/play
  - moonfish/lichess
  - moonfish/analyse
  - moonfish/book