From f93f48eef5f4aa0b87b16c6ff27e0dc25cbc6f8e Mon Sep 17 00:00:00 2001 From: Zsolt Tasnadi Date: Sun, 2 Aug 2026 22:17:57 +0200 Subject: [PATCH] binary assets: win-x86/win-x64/linux-x64 targetek + binaries CI step, v1.0.1 Co-Authored-By: Claude Fable 5 --- .woodpecker.yml | 5 +++++ Makefile | 46 ++++++++++++++++++++++++++++++++++++++++++++-- metadata.json | 2 +- 3 files changed, 50 insertions(+), 3 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 55776fe..8210c55 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -10,6 +10,11 @@ steps: commands: - make ci-export + - name: binaries + image: git.teletypegames.org/internal/ebitengine-builder:latest + commands: + - make ci-binaries + - name: artifact image: alpine environment: diff --git a/Makefile b/Makefile index 86276f0..a92ac43 100644 --- a/Makefile +++ b/Makefile @@ -37,6 +37,43 @@ export: wasm @echo "==> Cleaning temporary files" rm -f $(DIST_DIR)/$(WASM_NAME) $(DIST_DIR)/wasm_exec.js $(DIST_DIR)/index.html +# --- native binaries (lásd: teletypegames/NOTES_BINARY_PLAN.md) ------------- +# win-x86 / win-x64: pure Go cross-compile (Windowson nem kell cgo) +# linux-x64: cgo build, linux/amd64 hoston fut (builder image, X11/GL dev libekkel) +BINARY_TARGETS = win-x86 win-x64 linux-x64 + +binaries: + @if [ -z "$(VERSION)" ]; then \ + echo "ERROR: VERSION not set!"; exit 1; \ + fi + @for target in $(BINARY_TARGETS); do \ + $(MAKE) binary-$$target VERSION=$(VERSION) || exit 1; \ + done + +binary-win-x86: + @$(MAKE) binary-build VERSION=$(VERSION) B_GOOS=windows B_GOARCH=386 B_CGO=0 B_EXT=.exe B_TARGET=win-x86 + +binary-win-x64: + @$(MAKE) binary-build VERSION=$(VERSION) B_GOOS=windows B_GOARCH=amd64 B_CGO=0 B_EXT=.exe B_TARGET=win-x64 + +binary-linux-x64: + @$(MAKE) binary-build VERSION=$(VERSION) B_GOOS=linux B_GOARCH=amd64 B_CGO=1 B_EXT= B_TARGET=linux-x64 + +# belső helper: egy target buildje + zip egyetlen gyökérmappával +# (a zipet unixos zip készíti, így a végrehajtási bit megmarad) +binary-build: + @set -e; \ + PKG_DIR="$(PROJECT)-$(VERSION)-$(B_TARGET)"; \ + echo "==> Building $$PKG_DIR"; \ + rm -rf "$$PKG_DIR" "$$PKG_DIR.zip"; \ + mkdir -p "$$PKG_DIR"; \ + CGO_ENABLED=$(B_CGO) GOOS=$(B_GOOS) GOARCH=$(B_GOARCH) go build -o "$$PKG_DIR/$(PROJECT)$(B_EXT)" .; \ + if [ -f LICENSE ]; then cp LICENSE "$$PKG_DIR/"; fi; \ + if [ -f README.md ]; then cp README.md "$$PKG_DIR/"; fi; \ + zip -r "$$PKG_DIR.zip" "$$PKG_DIR" >/dev/null; \ + rm -rf "$$PKG_DIR"; \ + echo "==> $$PKG_DIR.zip kesz" + watch: fswatch -o . | while read; do make build; done @@ -59,18 +96,23 @@ 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; \ sshpass -p "$(DROPAREA_SSH_PASSWORD)" scp -o StrictHostKeyChecking=no -P $(DROPAREA_PORT) \ - $$FILE $$META_DST \ + $$FILE $$META_DST $$BINS \ $(DROPAREA_USER)@$(DROPAREA_HOST):$(DROPAREA_TARGET_PATH)/ ci-update: @VERSION=$$(cat $(VERSION_FILE)); \ curl "$(UPDATE_SERVER)/update?secret=$(UPDATE_SECRET)&name=$(PROJECT)&platform=ebitengine&version=$$VERSION" -.PHONY: all build wasm export watch clean ci-version ci-export ci-upload ci-update \ No newline at end of file +.PHONY: all build wasm export watch clean binaries binary-win-x86 binary-win-x64 binary-linux-x64 binary-build ci-version ci-export ci-binaries ci-upload ci-update \ No newline at end of file diff --git a/metadata.json b/metadata.json index abce49a..54c6a6c 100644 --- a/metadata.json +++ b/metadata.json @@ -5,5 +5,5 @@ "desc": "It's a simple demo program in Ebitengine", "site": "https://git.teletypegames.org/games/ebitenginedemo", "license": "MIT License", - "version": "1.0.0" + "version": "1.0.1" }