Replace the pipeline template with a marker: the config is served by the update server
This commit is contained in:
@@ -6,15 +6,11 @@ projects, in the same spirit as
|
|||||||
[godot-tools](../godot-tools).
|
[godot-tools](../godot-tools).
|
||||||
|
|
||||||
- `example-makefile.make` — project Makefile: local dev targets
|
- `example-makefile.make` — project Makefile: local dev targets
|
||||||
(`build`, `run`, `wasm`, `export`, `binaries`, `watch`, `clean`)
|
(`build`, `run`, `wasm`, `export`, `binaries`, `watch`, `clean`).
|
||||||
plus the Woodpecker pipeline targets (`ci-version`, `ci-export`,
|
- `example-woodpecker.yaml` — a one-line marker (`platform: bevy`): the
|
||||||
`ci-binaries`, `ci-upload`, `ci-publish`).
|
full pipeline (version → build → binaries → upload → publish) is served by the update server's Woodpecker
|
||||||
- `example-woodpecker.yaml` — Woodpecker pipeline: version → build
|
configuration extension — preview it with
|
||||||
(Rust, `wasm32-unknown-unknown` target + `wasm-bindgen` in the
|
`curl "https://teletypegames.org/build/config?platform=bevy"`.
|
||||||
`git.teletypegames.org/internal/bevy-builder` image) → binaries
|
|
||||||
(native linux-x64 + mingw win-x64) → upload (HTTP POST to `/build/upload`) →
|
|
||||||
publish (calls the teletypegames `/build/publish` endpoint with
|
|
||||||
`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
|
||||||
build against musl) with the wasm + `x86_64-pc-windows-gnu`
|
build against musl) with the wasm + `x86_64-pc-windows-gnu`
|
||||||
@@ -44,8 +40,11 @@ projects, in the same spirit as
|
|||||||
otherwise the generated JS glue refuses to load. The builder image
|
otherwise the generated JS glue refuses to load. The builder image
|
||||||
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` (a one-line marker — the
|
||||||
`update_secret_key` secret in Woodpecker.
|
pipeline itself is served by the update server; add `name:` when the
|
||||||
|
software name differs from the repo name) and add the
|
||||||
|
`application_token` secret in Woodpecker (an ApplicationToken with
|
||||||
|
the `update` + `upload` scopes, created in the admin).
|
||||||
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)`.
|
||||||
|
|
||||||
@@ -53,7 +52,7 @@ Local WASM builds additionally need
|
|||||||
`rustup target add wasm32-unknown-unknown` and the `wasm-bindgen` CLI
|
`rustup target add wasm32-unknown-unknown` and the `wasm-bindgen` CLI
|
||||||
(`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 served pipeline uploads `$(PROJECT)-$(VERSION).html.zip` and the native
|
||||||
binary zips (`-win-x64.zip`, `-linux-x64.zip`) via `/build/upload`, then
|
binary zips (`-win-x64.zip`, `-linux-x64.zip`) via `/build/upload`, then
|
||||||
triggers `/build/publish?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
|
||||||
|
|||||||
+1
-42
@@ -14,7 +14,6 @@ WASM_TARGET = wasm32-unknown-unknown
|
|||||||
WASM_RELEASE = target/$(WASM_TARGET)/release/$(PROJECT).wasm
|
WASM_RELEASE = target/$(WASM_TARGET)/release/$(PROJECT).wasm
|
||||||
OUTPUT_ZIP = $(PROJECT)-$(VERSION).html.zip
|
OUTPUT_ZIP = $(PROJECT)-$(VERSION).html.zip
|
||||||
|
|
||||||
VERSION_FILE = .version
|
|
||||||
INDEX_HTML_URL = https://git.teletypegames.org/tools/bevy-tools/raw/branch/master/web/index.html
|
INDEX_HTML_URL = https://git.teletypegames.org/tools/bevy-tools/raw/branch/master/web/index.html
|
||||||
|
|
||||||
all: build
|
all: build
|
||||||
@@ -92,44 +91,4 @@ watch:
|
|||||||
clean:
|
clean:
|
||||||
rm -rf $(BIN_DIR) $(DIST_DIR) target
|
rm -rf $(BIN_DIR) $(DIST_DIR) target
|
||||||
|
|
||||||
ci-version:
|
.PHONY: all build run wasm export binaries binary-linux binary-win watch clean
|
||||||
@if [ -f metadata.json ]; then \
|
|
||||||
VERSION=$$(jq -r '.version' metadata.json); \
|
|
||||||
else \
|
|
||||||
VERSION=$$(git rev-parse --short HEAD); \
|
|
||||||
fi; \
|
|
||||||
BRANCH=$$(git rev-parse --abbrev-ref HEAD); \
|
|
||||||
if [ "$$BRANCH" != "main" ] && [ "$$BRANCH" != "master" ]; then \
|
|
||||||
VERSION="dev-$$VERSION-$$BRANCH"; \
|
|
||||||
fi; \
|
|
||||||
echo $$VERSION > $(VERSION_FILE)
|
|
||||||
|
|
||||||
ci-export:
|
|
||||||
@VERSION=$$(cat $(VERSION_FILE)); \
|
|
||||||
$(MAKE) export VERSION=$$VERSION
|
|
||||||
|
|
||||||
ci-binaries:
|
|
||||||
@VERSION=$$(cat $(VERSION_FILE)); \
|
|
||||||
$(MAKE) binaries VERSION=$$VERSION
|
|
||||||
|
|
||||||
ci-upload:
|
|
||||||
@VERSION=$$(cat $(VERSION_FILE)); \
|
|
||||||
FILE="$(PROJECT)-$$VERSION.html.zip"; \
|
|
||||||
META_SRC="metadata.json"; \
|
|
||||||
META_DST="$(PROJECT)-$$VERSION.metadata.json"; \
|
|
||||||
cp $$META_SRC $$META_DST; \
|
|
||||||
BINS=""; \
|
|
||||||
for slug in $(BINARY_SLUGS); do \
|
|
||||||
[ -f "$(PROJECT)-$$VERSION-$$slug.zip" ] && BINS="$$BINS $(PROJECT)-$$VERSION-$$slug.zip"; \
|
|
||||||
done; \
|
|
||||||
for f in $$FILE $$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-publish:
|
|
||||||
@VERSION=$$(cat $(VERSION_FILE)); \
|
|
||||||
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-publish
|
|
||||||
|
|||||||
+5
-38
@@ -1,38 +1,5 @@
|
|||||||
steps:
|
# One-line marker: the full pipeline is served by the update server's
|
||||||
- name: version
|
# Woodpecker configuration extension. Preview it with:
|
||||||
image: alpine
|
# curl "https://teletypegames.org/build/config?platform=bevy"
|
||||||
commands:
|
platform: bevy
|
||||||
- apk add --no-cache git make jq
|
# name: mygame # only when the software name differs from the repo name
|
||||||
- make ci-version
|
|
||||||
|
|
||||||
- name: build
|
|
||||||
image: git.teletypegames.org/internal/bevy-builder:latest
|
|
||||||
pull: true
|
|
||||||
commands:
|
|
||||||
- make ci-export
|
|
||||||
|
|
||||||
- name: binaries
|
|
||||||
image: git.teletypegames.org/internal/bevy-builder:latest
|
|
||||||
pull: true
|
|
||||||
commands:
|
|
||||||
- make ci-binaries
|
|
||||||
|
|
||||||
- name: upload
|
|
||||||
image: alpine
|
|
||||||
environment:
|
|
||||||
UPDATE_SERVER: https://teletypegames.org
|
|
||||||
UPDATE_SECRET:
|
|
||||||
from_secret: update_secret_key
|
|
||||||
commands:
|
|
||||||
- apk add --no-cache make curl
|
|
||||||
- make ci-upload
|
|
||||||
|
|
||||||
- name: publish
|
|
||||||
image: alpine
|
|
||||||
environment:
|
|
||||||
UPDATE_SERVER: https://teletypegames.org
|
|
||||||
UPDATE_SECRET:
|
|
||||||
from_secret: update_secret_key
|
|
||||||
commands:
|
|
||||||
- apk add --no-cache make curl
|
|
||||||
- make ci-publish
|
|
||||||
|
|||||||
Reference in New Issue
Block a user