From 93fb8a00562c16f590a94403c11360dd54157ac0 Mon Sep 17 00:00:00 2001 From: Zsolt Tasnadi Date: Wed, 5 Aug 2026 20:32:34 +0200 Subject: [PATCH] Switch the CI templates to the /build HTTP endpoints --- README.md | 8 ++++---- example-makefile.make | 12 +++++++----- example-woodpecker.yaml | 11 ++++------- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index be2850f..9e74f4f 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,8 @@ projects, in the same spirit as [tic80-tools](../tic80-tools). `ci-binaries`, `ci-upload`, `ci-update`). - `example-woodpecker.yaml` — Woodpecker pipeline: version → export (`.love` package + love.js web build) → binaries (fused desktop - builds) → upload (scp to the droparea) → update (calls the - teletypegames `/update` endpoint with `platform=love`). + builds) → upload (HTTP POST to `/build/upload`) → update (calls the + teletypegames `/build/publish` endpoint with `platform=love`). - `example-tasks.json` — VS Code `.vscode/tasks.json` with the common dev tasks: **Run Löve** (`love .`, default build task, `Cmd+Shift+B`), **Build & Run Löve**, **Build .love package** and @@ -21,13 +21,13 @@ projects, in the same spirit as [tic80-tools](../tic80-tools). 1. Copy `example-makefile.make` to `Makefile` and set `PROJECT` (the package is built as `dist/$(PROJECT).love`). 2. 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. 3. Copy `example-tasks.json` to `.vscode/tasks.json`. The pipeline uploads `$(PROJECT)-$(VERSION).love.zip`, `$(PROJECT)-$(VERSION).html.zip`, the versioned `metadata.json` and the fused binary zips (`-win-x64.zip`, `-mac-universal.zip`, -`-linux-x64.zip`) to the droparea, then triggers `/update` twice: once +`-linux-x64.zip`) via `/build/upload`, then triggers `/build/publish` twice: once with `platform=love` (desktop package) and once with `platform=love-web` (web build). The API's `BinaryAttachment` concern picks up the `--.zip` files automatically and diff --git a/example-makefile.make b/example-makefile.make index f90b1da..2ad5b04 100644 --- a/example-makefile.make +++ b/example-makefile.make @@ -199,13 +199,15 @@ 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_LOVE $$FILE_WEB $$META_DST $$BINS \ - $(DROPAREA_USER)@$(DROPAREA_HOST):$(DROPAREA_TARGET_PATH)/ + for f in $$FILE_LOVE $$FILE_WEB $$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=love&version=$$VERSION"; \ - curl "$(UPDATE_SERVER)/update?secret=$(UPDATE_SECRET)&name=$(PROJECT)&platform=love-web&version=$$VERSION" + curl -fsS -X POST -H "X-Update-Secret: $(UPDATE_SECRET)" "$(UPDATE_SERVER)/build/publish?name=$(PROJECT)&platform=love&version=$$VERSION"; \ + curl -fsS -X POST -H "X-Update-Secret: $(UPDATE_SECRET)" "$(UPDATE_SERVER)/build/publish?name=$(PROJECT)&platform=love-web&version=$$VERSION" .PHONY: all build love web export binaries binary-win binary-mac binary-linux watch clean ci-version ci-export ci-binaries ci-upload ci-update \ No newline at end of file diff --git a/example-woodpecker.yaml b/example-woodpecker.yaml index 405b5fc..7b567d0 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