Replace the pipeline template with a marker: the config is served by the update server
This commit is contained in:
@@ -7,13 +7,11 @@ and [tic80-tools](../tic80-tools).
|
||||
- `example-makefile.make` — project Makefile: local dev targets
|
||||
(`build`, `run`, `web`, `export`, `watch`, `clean`), the desktop
|
||||
binary targets (`binaries`, `binary-win-x86`, `binary-win-x64`,
|
||||
`binary-linux-x64`, `binary-mac-universal`) plus the Woodpecker
|
||||
pipeline targets (`ci-version`, `ci-export`, `ci-binaries`,
|
||||
`ci-upload`, `ci-publish`).
|
||||
- `example-woodpecker.yaml` — Woodpecker pipeline: version → build
|
||||
(headless web export + desktop binaries in the `barichello/godot-ci`
|
||||
image) → upload (HTTP POST to `/build/upload`) → update (calls the
|
||||
teletypegames `/build/publish` endpoint with `platform=godot`).
|
||||
`binary-linux-x64`, `binary-mac-universal`).
|
||||
- `example-woodpecker.yaml` — a one-line marker (`platform: godot`): the
|
||||
full pipeline (version → build → upload → publish) is served by the update server's Woodpecker
|
||||
configuration extension — preview it with
|
||||
`curl "https://teletypegames.org/build/config?platform=godot"`.
|
||||
- `example-export_presets.cfg` — `export_presets.cfg` with the **Web**
|
||||
preset the Makefile exports plus the desktop presets (**Windows
|
||||
x86**, **Windows x64**, **Linux x64**, **Mac universal**). Web
|
||||
@@ -40,14 +38,17 @@ and [tic80-tools](../tic80-tools).
|
||||
|
||||
textures/vram_compression/import_etc2_astc=true
|
||||
```
|
||||
3. Copy `example-woodpecker.yaml` to `.woodpecker.yaml` and add the
|
||||
`update_secret_key` secret in Woodpecker.
|
||||
Match the `godot-builder` image tag to the Godot version the
|
||||
project is made with (e.g. `4.6`) — the underlying
|
||||
`barichello/godot-ci` image ships the matching export templates.
|
||||
3. Copy `example-woodpecker.yaml` to `.woodpecker.yaml` (a one-line marker — the
|
||||
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).
|
||||
The `godot-builder` image tag (and with it the export-template
|
||||
version) is set server-side in the update server's `ci_platforms`
|
||||
config, not per repo.
|
||||
4. Copy `example-tasks.json` to `.vscode/tasks.json`.
|
||||
|
||||
The pipeline uploads `$(PROJECT)-$(VERSION).html.zip` and the desktop
|
||||
The served pipeline uploads `$(PROJECT)-$(VERSION).html.zip` and the desktop
|
||||
binary zips (`$(PROJECT)-$(VERSION)-<target>.zip`, targets: `win-x86`,
|
||||
`win-x64`, `linux-x64`, `mac-universal`) via `/build/upload`, then triggers
|
||||
`/build/publish?platform=godot&name=$(PROJECT)&version=$(VERSION)`, which
|
||||
|
||||
+1
-40
@@ -11,8 +11,6 @@ DIST_DIR = dist
|
||||
WEB_DIR = $(DIST_DIR)/web
|
||||
OUTPUT_ZIP = $(PROJECT)-$(VERSION).html.zip
|
||||
|
||||
VERSION_FILE = .version
|
||||
|
||||
all: build
|
||||
|
||||
build:
|
||||
@@ -102,41 +100,4 @@ watch:
|
||||
clean:
|
||||
rm -rf $(DIST_DIR) .godot
|
||||
|
||||
ci-version:
|
||||
@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"; \
|
||||
BINS=$$(ls $(PROJECT)-$$VERSION-*.zip 2>/dev/null || true); \
|
||||
cp $$META_SRC $$META_DST; \
|
||||
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=godot&version=$$VERSION"
|
||||
|
||||
.PHONY: all build run web export watch clean binaries binary-win-x86 binary-win-x64 binary-linux-x64 binary-mac-universal binary-build binary-build-mac ci-version ci-export ci-binaries ci-upload ci-publish
|
||||
.PHONY: all build run web export watch clean binaries binary-win-x86 binary-win-x64 binary-linux-x64 binary-mac-universal binary-build binary-build-mac
|
||||
|
||||
+5
-32
@@ -1,32 +1,5 @@
|
||||
steps:
|
||||
- name: version
|
||||
image: alpine
|
||||
commands:
|
||||
- apk add --no-cache git make jq
|
||||
- make ci-version
|
||||
|
||||
- name: build
|
||||
image: git.teletypegames.org/internal/godot-builder:4.6
|
||||
commands:
|
||||
- make ci-export
|
||||
- make ci-binaries
|
||||
|
||||
- name: artifact
|
||||
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
|
||||
# One-line marker: the full pipeline is served by the update server's
|
||||
# Woodpecker configuration extension. Preview it with:
|
||||
# curl "https://teletypegames.org/build/config?platform=godot"
|
||||
platform: godot
|
||||
# name: mygame # only when the software name differs from the repo name
|
||||
|
||||
Reference in New Issue
Block a user