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`).
|
`ci-binaries`, `ci-upload`, `ci-update`).
|
||||||
- `example-woodpecker.yaml` — Woodpecker pipeline: version → export
|
- `example-woodpecker.yaml` — Woodpecker pipeline: version → export
|
||||||
(`.love` package + love.js web build) → binaries (fused desktop
|
(`.love` package + love.js web build) → binaries (fused desktop
|
||||||
builds) → upload (scp to the droparea) → update (calls the
|
builds) → upload (HTTP POST to `/build/upload`) → update (calls the
|
||||||
teletypegames `/update` endpoint with `platform=love`).
|
teletypegames `/build/publish` endpoint with `platform=love`).
|
||||||
- `example-tasks.json` — VS Code `.vscode/tasks.json` with the common
|
- `example-tasks.json` — VS Code `.vscode/tasks.json` with the common
|
||||||
dev tasks: **Run Löve** (`love .`, default build task,
|
dev tasks: **Run Löve** (`love .`, default build task,
|
||||||
`Cmd+Shift+B`), **Build & Run Löve**, **Build .love package** and
|
`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`
|
1. Copy `example-makefile.make` to `Makefile` and set `PROJECT`
|
||||||
(the package is built as `dist/$(PROJECT).love`).
|
(the package is built as `dist/$(PROJECT).love`).
|
||||||
2. Copy `example-woodpecker.yaml` to `.woodpecker.yaml` and add the
|
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`.
|
3. Copy `example-tasks.json` to `.vscode/tasks.json`.
|
||||||
|
|
||||||
The pipeline uploads `$(PROJECT)-$(VERSION).love.zip`,
|
The pipeline uploads `$(PROJECT)-$(VERSION).love.zip`,
|
||||||
`$(PROJECT)-$(VERSION).html.zip`, the versioned `metadata.json` and
|
`$(PROJECT)-$(VERSION).html.zip`, the versioned `metadata.json` and
|
||||||
the fused binary zips (`-win-x64.zip`, `-mac-universal.zip`,
|
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
|
with `platform=love` (desktop package) and once with
|
||||||
`platform=love-web` (web build). The API's `BinaryAttachment` concern
|
`platform=love-web` (web build). The API's `BinaryAttachment` concern
|
||||||
picks up the `<name>-<version>-<slug>.zip` files automatically and
|
picks up the `<name>-<version>-<slug>.zip` files automatically and
|
||||||
|
|||||||
@@ -199,13 +199,15 @@ ci-upload:
|
|||||||
for slug in $(BINARY_SLUGS); do \
|
for slug in $(BINARY_SLUGS); do \
|
||||||
[ -f "$(PROJECT)-$$VERSION-$$slug.zip" ] && BINS="$$BINS $(PROJECT)-$$VERSION-$$slug.zip"; \
|
[ -f "$(PROJECT)-$$VERSION-$$slug.zip" ] && BINS="$$BINS $(PROJECT)-$$VERSION-$$slug.zip"; \
|
||||||
done; \
|
done; \
|
||||||
sshpass -p "$(DROPAREA_SSH_PASSWORD)" scp -o StrictHostKeyChecking=no -P $(DROPAREA_PORT) \
|
for f in $$FILE_LOVE $$FILE_WEB $$META_DST $$BINS; do \
|
||||||
$$FILE_LOVE $$FILE_WEB $$META_DST $$BINS \
|
curl -fsS -H "X-Update-Secret: $(UPDATE_SECRET)" \
|
||||||
$(DROPAREA_USER)@$(DROPAREA_HOST):$(DROPAREA_TARGET_PATH)/
|
-F "file=@$$f" \
|
||||||
|
"$(UPDATE_SERVER)/build/upload?name=$(PROJECT)&version=$$VERSION" || exit 1; \
|
||||||
|
done
|
||||||
|
|
||||||
ci-update:
|
ci-update:
|
||||||
@VERSION=$$(cat $(VERSION_FILE)); \
|
@VERSION=$$(cat $(VERSION_FILE)); \
|
||||||
curl "$(UPDATE_SERVER)/update?secret=$(UPDATE_SECRET)&name=$(PROJECT)&platform=love&version=$$VERSION"; \
|
curl -fsS -X POST -H "X-Update-Secret: $(UPDATE_SECRET)" "$(UPDATE_SERVER)/build/publish?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-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
|
.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
|
- name: upload
|
||||||
image: alpine
|
image: alpine
|
||||||
environment:
|
environment:
|
||||||
DROPAREA_HOST: vps.teletype.hu
|
UPDATE_SERVER: https://teletypegames.org
|
||||||
DROPAREA_PORT: 2223
|
UPDATE_SECRET:
|
||||||
DROPAREA_TARGET_PATH: /home/drop
|
from_secret: update_secret_key
|
||||||
DROPAREA_USER: drop
|
|
||||||
DROPAREA_SSH_PASSWORD:
|
|
||||||
from_secret: droparea_ssh_password
|
|
||||||
commands:
|
commands:
|
||||||
- apk add --no-cache make openssh-client sshpass
|
- apk add --no-cache make curl
|
||||||
- make ci-upload
|
- make ci-upload
|
||||||
|
|
||||||
- name: update
|
- name: update
|
||||||
|
|||||||
Reference in New Issue
Block a user