diff --git a/.woodpecker.yml b/.woodpecker.yml index 048bfdc..5297e77 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -22,14 +22,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-upload' - name: update diff --git a/Makefile b/Makefile index df54eb7..4486ddb 100644 --- a/Makefile +++ b/Makefile @@ -17,10 +17,6 @@ ASSETS_LUA = inc/meta/meta.assets.lua # CI/CD variables VERSION_FILE = .version GAME_LANG ?= lua -DROPAREA_HOST ?= vps.teletype.hu -DROPAREA_PORT ?= 2223 -DROPAREA_TARGET_PATH ?= /home/drop -DROPAREA_USER ?= drop UPDATE_SERVER ?= https://teletypegames.org all: build @@ -147,13 +143,16 @@ ci-upload: for slug in $(BINARY_SLUGS); do \ [ -f "$(PROJECT)-$$VERSION-$$slug.zip" ] && BINS="$$BINS $(PROJECT)-$$VERSION-$$slug.zip"; \ done; \ - SCP_TARGET="$(DROPAREA_USER)@$(DROPAREA_HOST):$(DROPAREA_TARGET_PATH)/"; \ - sshpass -p "$(DROPAREA_SSH_PASSWORD)" scp -o StrictHostKeyChecking=no -P $(DROPAREA_PORT) $$FILE_LUA $$FILE_TIC $$FILE_HTML_ZIP $$BINS $$SCP_TARGET + for f in $$FILE_LUA $$FILE_TIC $$FILE_HTML_ZIP $$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)); \ echo "==> Triggering update for version $$VERSION"; \ - curl "$(UPDATE_SERVER)/update?secret=$(UPDATE_SECRET)&name=$(PROJECT)&platform=tic80&version=$$VERSION" + curl -fsS -X POST -H "X-Update-Secret: $(UPDATE_SECRET)" "$(UPDATE_SERVER)/build/publish?name=$(PROJECT)&platform=tic80&version=$$VERSION" .PHONY: all build export binaries watch import_assets export_assets clean ci-version ci-export ci-binaries ci-upload ci-update