Switch the CI templates to the /build HTTP endpoints
This commit is contained in:
@@ -10,8 +10,8 @@ CI/CD templates for [TIC-80](https://tic80.com) (Lua) game projects.
|
||||
`ci-update`).
|
||||
- `example-woodpecker.yaml` — Woodpecker pipeline: version → lint →
|
||||
minify → docs → export (TIC-80 Pro image) → binaries (native
|
||||
players, same image) → artifact (scp to the droparea) → update
|
||||
(calls the teletypegames `/update` endpoint with `platform=tic80`).
|
||||
players, same image) → artifact (HTTP POST to `/build/upload`) → update
|
||||
(calls the teletypegames `/build/publish` endpoint with `platform=tic80`).
|
||||
- `example-tasks.json` — VS Code `.vscode/tasks.json` with the common
|
||||
dev tasks: **Run TIC80** (default build task, `Cmd+Shift+B`),
|
||||
**Build & Run TIC80**, **Export assets** and **Make build**.
|
||||
@@ -22,14 +22,14 @@ CI/CD templates for [TIC-80](https://tic80.com) (Lua) game projects.
|
||||
(the cartridge is built as `$(PROJECT).lua` from the file list in
|
||||
`$(PROJECT).inc`).
|
||||
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` and replace the
|
||||
cart name (`impostor.lua`) with `$(PROJECT).lua`.
|
||||
|
||||
The pipeline uploads `$(PROJECT)-$(VERSION).lua`, `.tic`, `.html.zip`,
|
||||
`-docs.zip` and the native player zips (`-win-x64.zip`,
|
||||
`-linux-x64.zip`, `-mac-x64.zip`) to the droparea, then triggers
|
||||
`/update?platform=tic80&name=$(PROJECT)&version=$(VERSION)`. The API's
|
||||
`-linux-x64.zip`, `-mac-x64.zip`) via `/build/upload`, then triggers
|
||||
`/build/publish?platform=tic80&name=$(PROJECT)&version=$(VERSION)`. The API's
|
||||
`BinaryAttachment` concern picks up the `<name>-<version>-<slug>.zip`
|
||||
files automatically and registers them as `win_x64` / `linux_x64` /
|
||||
`mac_x64` release assets.
|
||||
@@ -42,7 +42,7 @@ things to know:
|
||||
|
||||
- The player templates are **downloaded from tic80.com at export
|
||||
time**, so the CI step needs network access (the Woodpecker steps
|
||||
have it — the same way the artifact step reaches the droparea).
|
||||
have it — the same way the artifact step reaches the API).
|
||||
- All upstream players are x86-64 — the mac binary is Intel-only
|
||||
(runs via Rosetta on Apple Silicon), hence the `mac-x64` slug.
|
||||
|
||||
|
||||
+6
-13
@@ -26,10 +26,6 @@ LINT_TMP_MAP := /tmp/_lint_map.txt
|
||||
# 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
|
||||
@@ -287,18 +283,15 @@ ci-artifact:
|
||||
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) \
|
||||
$(PROJECT)-$$VERSION.lua \
|
||||
$(PROJECT)-$$VERSION.tic \
|
||||
$(PROJECT)-$$VERSION.html.zip \
|
||||
$(PROJECT)-$$VERSION-docs.zip \
|
||||
$$BINS \
|
||||
$$SCP_TARGET
|
||||
for f in $(PROJECT)-$$VERSION.lua $(PROJECT)-$$VERSION.tic $(PROJECT)-$$VERSION.html.zip $(PROJECT)-$$VERSION-docs.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 download-minify minify export binaries watch import_assets export_assets clean lint install_precommit_hook docs ci-version ci-lint ci-minify ci-docs ci-export ci-binaries ci-artifact ci-update
|
||||
|
||||
@@ -47,14 +47,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
|
||||
|
||||
Reference in New Issue
Block a user