Switch the CI templates to the /build HTTP endpoints
This commit is contained in:
@@ -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 `<name>-<version>-<slug>.zip` files automatically and
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user