diff --git a/README.md b/README.md index a3cf090..55b1649 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ spirit as [tic80-tools](../tic80-tools). Woodpecker pipeline targets (`ci-version`, `ci-build`, `ci-artifact`, `ci-update`). - `example-woodpecker.yaml` — Woodpecker pipeline: version → build - (Debian, `apt install acme`) → artifact (scp to the droparea) → - update (calls the teletypegames `/update` endpoint with + (Debian, `apt install acme`) → artifact (HTTP POST to `/build/upload`) → + update (calls the teletypegames `/build/publish` endpoint with `platform=c64`). - `example-metadata.json` — catalog metadata; the `version` field drives `ci-version`, the rest (`name`, `title`, `author`, `desc`, `site`, @@ -26,7 +26,7 @@ spirit as [tic80-tools](../tic80-tools). 2. Copy `example-metadata.json` to `metadata.json` and fill it in; `name` must match `PROJECT`. 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`. ## Builder image @@ -43,6 +43,6 @@ docker push git.teletypegames.org/internal/c64-builder:latest ``` The pipeline uploads `$(PROJECT)-$(VERSION).prg` and -`$(PROJECT)-$(VERSION).metadata.json` to the droparea, then triggers -`/update?platform=c64&name=$(PROJECT)&version=$(VERSION)`, which +`$(PROJECT)-$(VERSION).metadata.json` via `/build/upload`, then triggers +`/build/publish?platform=c64&name=$(PROJECT)&version=$(VERSION)`, which creates/updates the Software row and a Release with `cartridge_path`. diff --git a/example-makefile.make b/example-makefile.make index dc66e43..9038307 100644 --- a/example-makefile.make +++ b/example-makefile.make @@ -16,10 +16,6 @@ UNAME_S := $(shell uname -s) # CI/CD variables VERSION_FILE = .version -DROPAREA_HOST ?= vps.teletype.hu -DROPAREA_PORT ?= 2223 -DROPAREA_TARGET_PATH ?= /home/drop -DROPAREA_USER ?= drop UPDATE_SERVER ?= https://teletypegames.org all: build @@ -77,15 +73,15 @@ ci-build: build ci-artifact: @VERSION=$$(cat $(VERSION_FILE)); \ echo "==> Uploading artifacts for version $$VERSION"; \ - SCP_TARGET="$(DROPAREA_USER)@$(DROPAREA_HOST):$(DROPAREA_TARGET_PATH)/"; \ - sshpass -p "$(DROPAREA_SSH_PASSWORD)" scp -o StrictHostKeyChecking=no -P $(DROPAREA_PORT) \ - $(PROJECT)-$$VERSION.prg \ - $(PROJECT)-$$VERSION.metadata.json \ - $$SCP_TARGET + for f in $(PROJECT)-$$VERSION.prg $(PROJECT)-$$VERSION.metadata.json; 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)); \ echo "==> Triggering update for version $$VERSION"; \ - curl "$(UPDATE_SERVER)/update?secret=$(UPDATE_SECRET)&name=$(PROJECT)&platform=c64&version=$$VERSION" + curl -fsS -X POST -H "X-Update-Secret: $(UPDATE_SECRET)" "$(UPDATE_SERVER)/build/publish?name=$(PROJECT)&platform=c64&version=$$VERSION" .PHONY: all deps build run clear rebuild rebuildrun ci-version ci-build ci-artifact ci-update diff --git a/example-woodpecker.yaml b/example-woodpecker.yaml index e1b3f0d..9dc4404 100644 --- a/example-woodpecker.yaml +++ b/example-woodpecker.yaml @@ -13,14 +13,11 @@ steps: - name: artifact 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-artifact' - name: update