Ebitengine (formerly Ebiten) is a simple and efficient 2D game engine for Go. It focuses on performance, portability, and ease of use, making it suitable for both prototypes and production-ready games.
Website: https://ebitengine.org
This Makefile provides a simple, reproducible workflow for building Ebitengine Go projects for both native desktop and WebAssembly (WASM) targets. It is designed for indie game development with automated version management and CI/CD deployment support.
The workflow is based on four core ideas:
metadata.json or git commit hashThis approach keeps the build process simple while supporting both desktop and web platforms.
| Variable | Description | Default |
|---|---|---|
PROJECT |
Project name (used in output filenames) | ebitenginedemo |
BIN_DIR |
Directory for native executable | bin |
DIST_DIR |
Directory for WASM and packaged artifacts | dist |
WASM_NAME |
WebAssembly filename | game.wasm |
VERSION_FILE |
File storing version for CI/CD | .version |
INDEX_HTML_URL |
URL to download index.html template | Remote ebitengine-tools repo |
make build
bin/ebitenginedemo (or bin/<PROJECT> if PROJECT is changed)go build with current platform (Linux, macOS, Windows)make wasm
dist/game.wasm)wasm_exec.js) to dist/make export VERSION=1.0.0
VERSION variable.make wasm)index.html template from remote repositorygame.wasmwasm_exec.jsindex.htmlebitenginedemo-1.0.0.html.zipmake watch
fswatch to be installed.)make clean
bin/ directory (native executable)dist/ directory (WASM, runtime, packaged files)make ci-versionmetadata.json (if exists) or uses git short commit hashmain or master, prefixes version as dev-<version>-<branch>.version file for use in subsequent CI stepsExample outputs:
1.0.0dev-1.0.0-feature-branchmake ci-export.version filemake export with the stored VERSIONmake ci-upload.version filemetadata.json to ebitenginedemo-<version>.metadata.jsonDROPAREA_SSH_PASSWORD - SSH passwordDROPAREA_PORT - SSH portDROPAREA_USER - SSH usernameDROPAREA_HOST - Server hostnameDROPAREA_TARGET_PATH - Target directory on servermake ci-update.version fileebitengineebitengine.versionUPDATE_SERVER - Update server URLUPDATE_SECRET - Authentication secret| File | Description |
|---|---|
bin/ebitenginedemo |
Native executable for current OS |
dist/game.wasm |
WebAssembly binary |
dist/wasm_exec.js |
Go WASM runtime helper |
ebitenginedemo-<version>.html.zip |
Packaged web build (index.html + WASM + runtime) |
makego (1.11+)curl (for downloading index.html)zip (for packaging exports)fswatch (only for watch mode)sshpass and scp (for ci-upload target)jq (for parsing metadata.json in ci-version)git (for version fallback and branch detection in ci-version)This document describes the Woodpecker CI pipeline used to build, export, upload, and publish an Ebitengine game project.
The pipeline logic is almost entirely encapsulated within a Makefile, which is called by each pipeline step. This approach simplifies the CI configuration and keeps the build logic centralized.
The pipeline performs the following steps:
metadata.json or git commit hash.Each step corresponds to a make ci-* target.
- name: version
image: alpine
commands:
- 'apk add --no-cache make git jq'
- 'make ci-version'
What it does:
make, git, and jq for processing JSON.make ci-version, which:
metadata.json (if exists) or falls back to git short commit hash.main or master), prefixes the version as dev-<version>-<branch>..version file for subsequent steps to use.- name: build
image: golang:1.21
environment:
GOFLAGS: -mod=readonly
commands:
- 'apt-get update && apt-get install -y make curl zip'
- 'make ci-export'
What it does:
make, curl, and zip for packaging.make ci-export, which:
.version file.GOOS=js GOARCH=wasm).wasm_exec.js) to the output directory.index.html template from the remote ebitengine-tools repository.ebitenginedemo-<version>.html.zip.- 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'
What it does:
make and SSH tooling (openssh-client, sshpass).make ci-upload, which:
.version file.metadata.json to ebitenginedemo-<version>.metadata.json..html.zip and .metadata.json files to a remote server using scp.- 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'
What it does:
make and curl.make ci-update, which:
.version file.secret - Authorization tokenname - Project name (ebitenginedemo)platform - Platform identifier (ebitengine)version - Version from .version fileExample request:
https://games.vps.teletype.hu/update?secret=<SECRET>&name=ebitenginedemo&platform=ebitengine&version=1.0.0
After a successful run:
This pipeline enables fully automated Ebitengine releases where the entire build and release logic is managed by the project's Makefile.
https://git.teletype.hu/tools/ebitengine-tools/src/branch/master/example-woodpecker.yaml