From c3b92f1ff2afb77f493d6d4012d23ddb6abbf354 Mon Sep 17 00:00:00 2001 From: Zsolt Tasnadi Date: Wed, 5 Aug 2026 20:32:25 +0200 Subject: [PATCH] Switch the CI templates to the /build HTTP endpoints --- README.md | 10 +++++----- example-makefile.make | 10 ++++++---- example-woodpecker.yaml | 11 ++++------- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 5d6dc65..3ef1d72 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,8 @@ projects, in the same spirit as - `example-woodpecker.yaml` — Woodpecker pipeline: version → build (Rust, `wasm32-unknown-unknown` target + `wasm-bindgen` in the `git.teletypegames.org/internal/bevy-builder` image) → binaries - (native linux-x64 + mingw win-x64) → upload (scp to the droparea) → - update (calls the teletypegames `/update` endpoint with + (native linux-x64 + mingw win-x64) → upload (HTTP POST to `/build/upload`) → + update (calls the teletypegames `/build/publish` endpoint with `platform=bevy`). - `builder.Dockerfile` — the CI builder image: `rust:1-bookworm` (glibc — bevy's native linux build needs alsa/udev, which does not @@ -45,7 +45,7 @@ projects, in the same spirit as ships the CLI — when bumping the version, rebuild the image with the matching `--build-arg WASM_BINDGEN_VERSION`. 3. Copy `example-woodpecker.yaml` to `.woodpecker.yaml` and add the - `droparea_ssh_password` / `update_secret_key` secrets in Woodpecker. + `update_secret_key` secret in Woodpecker. 4. Copy `example-tasks.json` to `.vscode/tasks.json` and replace the binary name (`bevydemo`) with `$(PROJECT)`. @@ -54,8 +54,8 @@ Local WASM builds additionally need (`cargo install wasm-bindgen-cli --version 0.2.100`). The pipeline uploads `$(PROJECT)-$(VERSION).html.zip` and the native -binary zips (`-win-x64.zip`, `-linux-x64.zip`) to the droparea, then -triggers `/update?platform=bevy&name=$(PROJECT)&version=$(VERSION)`. +binary zips (`-win-x64.zip`, `-linux-x64.zip`) via `/build/upload`, then +triggers `/build/publish?platform=bevy&name=$(PROJECT)&version=$(VERSION)`. The API's `BinaryAttachment` concern picks up the `--.zip` files automatically and registers them as `win_x64` / `linux_x64` release assets. diff --git a/example-makefile.make b/example-makefile.make index 998c9fd..c88b061 100644 --- a/example-makefile.make +++ b/example-makefile.make @@ -122,12 +122,14 @@ ci-upload: for slug in $(BINARY_SLUGS); do \ [ -f "$(PROJECT)-$$VERSION-$$slug.zip" ] && BINS="$$BINS $(PROJECT)-$$VERSION-$$slug.zip"; \ done; \ - sshpass -p "$(DROPAREA_SSH_PASSWORD)" scp -o StrictHostKeyChecking=no -P $(DROPAREA_PORT) \ - $$FILE $$META_DST $$BINS \ - $(DROPAREA_USER)@$(DROPAREA_HOST):$(DROPAREA_TARGET_PATH)/ + for f in $$FILE $$META_DST $$BINS; do \ + curl -fsS -H "X-Update-Secret: $(UPDATE_SECRET)" \ + -F "file=@$$f" \ + "$(UPDATE_SERVER)/build/upload?name=$(PROJECT)&version=$$VERSION" || exit 1; \ + done ci-update: @VERSION=$$(cat $(VERSION_FILE)); \ - curl "$(UPDATE_SERVER)/update?secret=$(UPDATE_SECRET)&name=$(PROJECT)&platform=bevy&version=$$VERSION" + curl -fsS -X POST -H "X-Update-Secret: $(UPDATE_SECRET)" "$(UPDATE_SERVER)/build/publish?name=$(PROJECT)&platform=bevy&version=$$VERSION" .PHONY: all build run wasm export binaries binary-linux binary-win watch clean ci-version ci-export ci-binaries ci-upload ci-update diff --git a/example-woodpecker.yaml b/example-woodpecker.yaml index d3ecb6f..46e2560 100644 --- a/example-woodpecker.yaml +++ b/example-woodpecker.yaml @@ -20,14 +20,11 @@ steps: - name: upload image: alpine environment: - DROPAREA_HOST: vps.teletype.hu - DROPAREA_PORT: 2223 - DROPAREA_TARGET_PATH: /home/drop - DROPAREA_USER: drop - DROPAREA_SSH_PASSWORD: - from_secret: droparea_ssh_password + UPDATE_SERVER: https://teletypegames.org + UPDATE_SECRET: + from_secret: update_secret_key commands: - - apk add --no-cache make openssh-client sshpass + - apk add --no-cache make curl - make ci-upload - name: update