From d4c3621674fce70867fc4251ab59ec45de15a60f Mon Sep 17 00:00:00 2001 From: Zsolt Tasnadi Date: Fri, 30 Jan 2026 01:14:10 +0100 Subject: [PATCH] initial commit --- example-makefile.make | 64 +++++++++++++++++++++++++++++++++++++++++ example-woodpecker.yaml | 34 ++++++++++++++++++++++ web/index.html | 15 ++++++++++ 3 files changed, 113 insertions(+) create mode 100644 example-makefile.make create mode 100644 example-woodpecker.yaml create mode 100644 web/index.html diff --git a/example-makefile.make b/example-makefile.make new file mode 100644 index 0000000..c959c4f --- /dev/null +++ b/example-makefile.make @@ -0,0 +1,64 @@ +# ----------------------------------------- +# Makefile – Ebitengine project builder +# ----------------------------------------- + +PROJECT = ebitenginedemo + +BIN_DIR = bin +DIST_DIR = dist +WASM_NAME = game.wasm +OUTPUT_BIN = $(BIN_DIR)/$(PROJECT) +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.teletype.hu/tools/ebitengine-tools/raw/branch/master/web/index.html + +all: build + +build: + @mkdir -p $(BIN_DIR) + go build -o $(OUTPUT_BIN) . + +wasm: + @mkdir -p $(DIST_DIR) + GOOS=js GOARCH=wasm go build -o $(OUTPUT_WASM) . + cp "$$(go env GOROOT)/lib/wasm/wasm_exec.js" $(OUTPUT_JS) + +export: wasm + @if [ -z "$(VERSION)" ]; then \ + echo "ERROR: VERSION not set!"; exit 1; \ + fi + @echo "==> Downloading index.html" + curl -sSL $(INDEX_HTML_URL) -o $(DIST_DIR)/index.html + @echo "==> Packaging HTML/WASM for $(VERSION)" + zip -r $(OUTPUT_ZIP) -j $(DIST_DIR)/$(WASM_NAME) $(DIST_DIR)/wasm_exec.js $(DIST_DIR)/index.html + @echo "==> Cleaning temporary files" + rm -f $(DIST_DIR)/$(WASM_NAME) $(DIST_DIR)/wasm_exec.js $(DIST_DIR)/index.html + +watch: + fswatch -o . | while read; do make build; done + +clean: + rm -rf $(BIN_DIR) $(DIST_DIR) + +ci-version: + @VERSION=$$(git describe --tags --dirty --always); \ + echo $$VERSION > $(VERSION_FILE) + +ci-export: + @VERSION=$$(cat $(VERSION_FILE)); \ + $(MAKE) export VERSION=$$VERSION + +ci-upload: + @VERSION=$$(cat $(VERSION_FILE)); \ + FILE=$(OUTPUT_ZIP); \ + sshpass -p "$(DROPAREA_SSH_PASSWORD)" scp -o StrictHostKeyChecking=no -P $(DROPAREA_PORT) \ + $$FILE $(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 diff --git a/example-woodpecker.yaml b/example-woodpecker.yaml new file mode 100644 index 0000000..85143f4 --- /dev/null +++ b/example-woodpecker.yaml @@ -0,0 +1,34 @@ +steps: + - name: version + image: alpine + commands: + - apk add --no-cache git make + - make ci-version + + - name: build + image: golang:1.22 + commands: + - make ci-export + + - name: artifact + image: alpine + environment: + DROPAREA_HOST: vps.teletype.hu + DROPAREA_PORT: 2223 + DROPAREA_TARGET_PATH: /home/drop + DROPAREA_USER: drop + DROPAREA_SSH_PASSWORD: + from_secret: droparea_ssh_password + commands: + - apk add --no-cache make openssh-client sshpass + - make ci-upload + + - name: update + image: alpine + environment: + UPDATE_SERVER: https://games.vps.teletype.hu + UPDATE_SECRET: + from_secret: update_secret_key + commands: + - apk add --no-cache make curl + - make ci-update \ No newline at end of file diff --git a/web/index.html b/web/index.html new file mode 100644 index 0000000..0696f37 --- /dev/null +++ b/web/index.html @@ -0,0 +1,15 @@ + + + + + Ebitengine Game + + + + + +