diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..e049e43 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,34 @@ +kind: pipeline +type: docker +name: Build + +platform: + os: linux + arch: arm64 + +steps: +- name: Install dependencies + image: node-pnpm:16-alpine + commands: + - pnpm install --frozen-lockfile +- name: Build frontend + image: node-pnpm:16-alpine + commands: + - pnpm build +- name: Build server binary + image: rust:1.64.0-alpine + commands: + - cargo build --release +- name: Deploy site + image: alpine + commands: + - apk add curl ca-certificates zip + - cd dist && zip -r ../deploy.zip * && cd .. + - 'curl --fail --upload-file target/release/chs -H "Authorization: $GITEA_TOKEN" https://git.ashhhleyyy.dev/api/v1/packages/ash/generic/chs/$DRONE_COMMIT_SHA/chs' + environment: + GITEA_TOKEN: + from_secret: GITEA_TOKEN + +trigger: + event: [push] + branch: [main] diff --git a/README.md b/README.md new file mode 100644 index 0000000..48fe124 --- /dev/null +++ b/README.md @@ -0,0 +1,12 @@ +# chs + +A simple multiplayer chess game. + +## Running yourself + +My CI builds images for `aarch64` (not `amd64`/`x86_64` unfortunately), but you can build your own binary fairly easily. + +- Install [Rust](https://rust-lang.org/), [pnpm](https://pnpm.io) and [cargo-make](https://crates.io/crates/cargo-make). +- Run `pnpm install` to download the frontend dependences +- Run `cargo make build-release` to build an executable with the frontend bundled +- The resulting binary will be in `target/release/chs`