diff --git a/README.md b/README.md index ba10724..d3c8452 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,11 @@ projects, in the same spirit as [tic80-tools](../tic80-tools). - `example-makefile.make` — project Makefile: local dev targets (`build`, `wasm`, `export`, `watch`, `clean`), native binary targets (`binaries`, `binary-win-x86`, `binary-win-x64`, `binary-linux-x64`) - plus the Woodpecker pipeline targets (`ci-version`, `ci-export`, - `ci-binaries`, `ci-upload`, `ci-publish`). -- `example-woodpecker.yaml` — Woodpecker pipeline: version → export - (Go, `GOOS=js GOARCH=wasm`) → binaries (native desktop zips) → - upload (HTTP POST to `/build/upload`) → publish (calls the teletypegames - `/build/publish` endpoint with `platform=ebitengine`). + and the mac-host release targets (`binaries-mac`, `mac-release`). +- `example-woodpecker.yaml` — a one-line marker (`platform: ebitengine`): the + full pipeline (version → build → binaries → artifact → publish) is served by the update server's Woodpecker + configuration extension — preview it with + `curl "https://teletypegames.org/build/config?platform=ebitengine"`. - `example-tasks.json` — VS Code `.vscode/tasks.json` with the common dev tasks: **Run** (`go run .`, default build task, `Cmd+Shift+B`), **Build & Run**, **Build WASM** and **Make build**. @@ -22,12 +21,15 @@ projects, in the same spirit as [tic80-tools](../tic80-tools). 1. Copy `example-makefile.make` to `Makefile` and set `PROJECT` (the native binary is built to `bin/$(PROJECT)`). -2. Copy `example-woodpecker.yaml` to `.woodpecker.yaml` and add the - `update_secret_key` secret in Woodpecker. +2. 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). 3. Copy `example-tasks.json` to `.vscode/tasks.json` and replace the binary name (`ebitenginedemo`) with `$(PROJECT)`. -The pipeline uploads `$(PROJECT)-$(VERSION).html.zip` plus the native +The served pipeline uploads `$(PROJECT)-$(VERSION).html.zip` plus the native binary zips (`$(PROJECT)-$(VERSION)-.zip`, currently `win-x86`, `win-x64`, `linux-x64`) via `/build/upload`, then triggers `/build/publish?platform=ebitengine&name=$(PROJECT)&version=$(VERSION)`. diff --git a/example-makefile.make b/example-makefile.make index 4713b07..5841caa 100644 --- a/example-makefile.make +++ b/example-makefile.make @@ -12,10 +12,9 @@ OUTPUT_WASM = $(DIST_DIR)/$(WASM_NAME) OUTPUT_JS = $(DIST_DIR)/wasm_exec.js OUTPUT_ZIP = $(PROJECT)-$(VERSION).html.zip -VERSION_FILE = .version INDEX_HTML_URL = https://git.teletypegames.org/tools/ebitengine-tools/raw/branch/master/web/index.html -# a mac-release lokális futtatásához (CI-ban a woodpecker env adja ugyanezeket) +# for running mac-release locally (CI publishes over the served pipeline) UPDATE_SERVER ?= https://teletypegames.org all: build @@ -149,41 +148,4 @@ watch: clean: rm -rf $(BIN_DIR) $(DIST_DIR) -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=ebitengine&version=$$VERSION" - -.PHONY: all build wasm export watch clean binaries binaries-mac mac-release binary-win-x86 binary-win-x64 binary-linux-x64 binary-mac-x64 binary-mac-arm64 binary-build binary-build-mac ci-version ci-export ci-binaries ci-upload ci-publish \ No newline at end of file +.PHONY: all build wasm export watch clean binaries binaries-mac mac-release binary-win-x86 binary-win-x64 binary-linux-x64 binary-mac-x64 binary-mac-arm64 binary-build binary-build-mac diff --git a/example-woodpecker.yaml b/example-woodpecker.yaml index 2e0cc92..d667d5b 100644 --- a/example-woodpecker.yaml +++ b/example-woodpecker.yaml @@ -1,38 +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/ebitengine-builder:latest - pull: true - commands: - - make ci-export - - - name: binaries - image: git.teletypegames.org/internal/ebitengine-builder:latest - pull: true - commands: - - 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 \ No newline at end of file +# 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=ebitengine" +platform: ebitengine +# name: mygame # only when the software name differs from the repo name