Replace the pipeline template with a marker: the config is served by the update server

This commit is contained in:
2026-08-06 07:59:57 +02:00
parent d9b39718db
commit 0662c5f600
3 changed files with 17 additions and 82 deletions
+11 -10
View File
@@ -4,13 +4,11 @@ CI/CD templates for Commodore 64 (ACME + VICE) game projects, in the same
spirit as [tic80-tools](../tic80-tools). spirit as [tic80-tools](../tic80-tools).
- `example-makefile.make` — project Makefile: local dev targets - `example-makefile.make` — project Makefile: local dev targets
(`deps`, `build`, `run`, `clear`, `rebuild`, `rebuildrun`) plus the (`deps`, `build`, `run`, `clear`, `rebuild`, `rebuildrun`).
Woodpecker pipeline targets (`ci-version`, `ci-build`, `ci-artifact`, - `example-woodpecker.yaml` — a one-line marker (`platform: c64`): the
`ci-publish`). full pipeline (version → build → artifact → publish) is served by the update server's Woodpecker
- `example-woodpecker.yaml` — Woodpecker pipeline: version → build configuration extension — preview it with
(Debian, `apt install acme`) → artifact (HTTP POST to `/build/upload`) → `curl "https://teletypegames.org/build/config?platform=c64"`.
publish (calls the teletypegames `/build/publish` endpoint with
`platform=c64`).
- `example-metadata.json` — catalog metadata; the `version` field drives - `example-metadata.json` — catalog metadata; the `version` field drives
`ci-version`, the rest (`name`, `title`, `author`, `desc`, `site`, `ci-version`, the rest (`name`, `title`, `author`, `desc`, `site`,
`repo`, `license`) is what `SoftwareUpdater::C64Service` writes into `repo`, `license`) is what `SoftwareUpdater::C64Service` writes into
@@ -25,8 +23,11 @@ spirit as [tic80-tools](../tic80-tools).
`TARGET` if the .prg name differs from `$(PROJECT).prg`). `TARGET` if the .prg name differs from `$(PROJECT).prg`).
2. Copy `example-metadata.json` to `metadata.json` and fill it in; 2. Copy `example-metadata.json` to `metadata.json` and fill it in;
`name` must match `PROJECT`. `name` must match `PROJECT`.
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`. 4. Copy `example-tasks.json` to `.vscode/tasks.json`.
## Builder image ## Builder image
@@ -42,7 +43,7 @@ docker build --platform linux/amd64 -f builder.Dockerfile \
docker push git.teletypegames.org/internal/c64-builder:latest docker push git.teletypegames.org/internal/c64-builder:latest
``` ```
The pipeline uploads `$(PROJECT)-$(VERSION).prg` and The served pipeline uploads `$(PROJECT)-$(VERSION).prg` and
`$(PROJECT)-$(VERSION).metadata.json` via `/build/upload`, then triggers `$(PROJECT)-$(VERSION).metadata.json` via `/build/upload`, then triggers
`/build/publish?platform=c64&name=$(PROJECT)&version=$(VERSION)`, which `/build/publish?platform=c64&name=$(PROJECT)&version=$(VERSION)`, which
creates/updates the Software row and a Release with `cartridge_path`. creates/updates the Software row and a Release with `cartridge_path`.
+1 -41
View File
@@ -16,7 +16,6 @@ UNAME_S := $(shell uname -s)
# CI/CD variables # CI/CD variables
VERSION_FILE = .version VERSION_FILE = .version
UPDATE_SERVER ?= https://teletypegames.org
all: build all: build
@@ -45,43 +44,4 @@ rebuild: clear build
rebuildrun: clear build run rebuildrun: clear build run
# ----------------------------------------- .PHONY: all deps build run clear rebuild rebuildrun
# CI/CD Pipeline targets
# -----------------------------------------
ci-version:
@VERSION=$$(sed -n 's/.*"version"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' $(METADATA) | head -n 1); \
if [ -z "$$VERSION" ]; then \
echo "ERROR: no \"version\" field in $(METADATA)!"; \
exit 1; \
fi; \
BRANCH=$${CI_COMMIT_BRANCH:-$${WOODPECKER_BRANCH}}; \
BRANCH=$$(echo "$$BRANCH" | tr '/' '-'); \
if [ "$$BRANCH" != "main" ] && [ "$$BRANCH" != "master" ] && [ -n "$$BRANCH" ]; then \
VERSION=dev-$$VERSION-$$BRANCH; \
fi; \
echo "VERSION is: $$VERSION"; \
echo $$VERSION > $(VERSION_FILE)
ci-build: build
@VERSION=$$(cat $(VERSION_FILE)); \
echo "==> Creating versioned files for $$VERSION"; \
cp $(TARGET) $(PROJECT)-$$VERSION.prg; \
cp $(METADATA) $(PROJECT)-$$VERSION.metadata.json; \
ls -lh $(PROJECT)-$$VERSION.*
ci-artifact:
@VERSION=$$(cat $(VERSION_FILE)); \
echo "==> Uploading artifacts for version $$VERSION"; \
for f in $(PROJECT)-$$VERSION.prg $(PROJECT)-$$VERSION.metadata.json; 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)); \
echo "==> Publishing version $$VERSION"; \
curl -fsS -X POST -H "X-Update-Secret: $(UPDATE_SECRET)" "$(UPDATE_SERVER)/build/publish?name=$(PROJECT)&platform=c64&version=$$VERSION"
.PHONY: all deps build run clear rebuild rebuildrun ci-version ci-build ci-artifact ci-publish
+5 -31
View File
@@ -1,31 +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=c64"
commands: platform: c64
- 'apk add --no-cache make' # name: mygame # only when the software name differs from the repo name
- 'make ci-version'
- name: build
image: git.teletypegames.org/internal/c64-builder:latest
commands:
- 'make ci-build'
- 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-artifact'
- 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'