Switch the CI templates to the /build HTTP endpoints
This commit is contained in:
@@ -12,8 +12,8 @@ projects, in the same spirit as
|
|||||||
- `example-woodpecker.yaml` — Woodpecker pipeline: version → build
|
- `example-woodpecker.yaml` — Woodpecker pipeline: version → build
|
||||||
(Rust, `wasm32-unknown-unknown` target + `wasm-bindgen` in the
|
(Rust, `wasm32-unknown-unknown` target + `wasm-bindgen` in the
|
||||||
`git.teletypegames.org/internal/bevy-builder` image) → binaries
|
`git.teletypegames.org/internal/bevy-builder` image) → binaries
|
||||||
(native linux-x64 + mingw win-x64) → upload (scp to the droparea) →
|
(native linux-x64 + mingw win-x64) → upload (HTTP POST to `/build/upload`) →
|
||||||
update (calls the teletypegames `/update` endpoint with
|
update (calls the teletypegames `/build/publish` endpoint with
|
||||||
`platform=bevy`).
|
`platform=bevy`).
|
||||||
- `builder.Dockerfile` — the CI builder image: `rust:1-bookworm`
|
- `builder.Dockerfile` — the CI builder image: `rust:1-bookworm`
|
||||||
(glibc — bevy's native linux build needs alsa/udev, which does not
|
(glibc — bevy's native linux build needs alsa/udev, which does not
|
||||||
@@ -45,7 +45,7 @@ projects, in the same spirit as
|
|||||||
ships the CLI — when bumping the version, rebuild the image with
|
ships the CLI — when bumping the version, rebuild the image with
|
||||||
the matching `--build-arg WASM_BINDGEN_VERSION`.
|
the matching `--build-arg WASM_BINDGEN_VERSION`.
|
||||||
3. Copy `example-woodpecker.yaml` to `.woodpecker.yaml` and add the
|
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` and replace the
|
4. Copy `example-tasks.json` to `.vscode/tasks.json` and replace the
|
||||||
binary name (`bevydemo`) with `$(PROJECT)`.
|
binary name (`bevydemo`) with `$(PROJECT)`.
|
||||||
|
|
||||||
@@ -54,8 +54,8 @@ Local WASM builds additionally need
|
|||||||
(`cargo install wasm-bindgen-cli --version 0.2.100`).
|
(`cargo install wasm-bindgen-cli --version 0.2.100`).
|
||||||
|
|
||||||
The pipeline uploads `$(PROJECT)-$(VERSION).html.zip` and the native
|
The pipeline uploads `$(PROJECT)-$(VERSION).html.zip` and the native
|
||||||
binary zips (`-win-x64.zip`, `-linux-x64.zip`) to the droparea, then
|
binary zips (`-win-x64.zip`, `-linux-x64.zip`) via `/build/upload`, then
|
||||||
triggers `/update?platform=bevy&name=$(PROJECT)&version=$(VERSION)`.
|
triggers `/build/publish?platform=bevy&name=$(PROJECT)&version=$(VERSION)`.
|
||||||
The API's `BinaryAttachment` concern picks up the
|
The API's `BinaryAttachment` concern picks up the
|
||||||
`<name>-<version>-<slug>.zip` files automatically and registers them
|
`<name>-<version>-<slug>.zip` files automatically and registers them
|
||||||
as `win_x64` / `linux_x64` release assets.
|
as `win_x64` / `linux_x64` release assets.
|
||||||
|
|||||||
@@ -122,12 +122,14 @@ 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 $$META_DST $$BINS; do \
|
||||||
$$FILE $$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=bevy&version=$$VERSION"
|
curl -fsS -X POST -H "X-Update-Secret: $(UPDATE_SECRET)" "$(UPDATE_SERVER)/build/publish?name=$(PROJECT)&platform=bevy&version=$$VERSION"
|
||||||
|
|
||||||
.PHONY: all build run wasm export binaries binary-linux binary-win watch clean ci-version ci-export ci-binaries ci-upload ci-update
|
.PHONY: all build run wasm export binaries binary-linux binary-win 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