Phaser is a fast, free and open source HTML5 game framework for 2D games, written in JavaScript/TypeScript. It offers WebGL and Canvas rendering, arcade and matter.js physics, tweens, particles, and a large plugin ecosystem. Since Phaser games are plain web pages, they need no compilation or export step at all — which makes the publishing pipeline the simplest of all our engines.
Website: https://phaser.io
This Makefile provides a simple, reproducible workflow for packaging Phaser projects for the web. There is no bundler and no
node_modules: the pinnedphaser.min.jsbuild is downloaded from the jsDelivr CDN at export time (the same way love-tools downloads love.js), and the game sources are concatenated into a singlegame.js.
The workflow is based on four core ideas:
src/*.js and are concatenated in filename order into game.js (prefix files with numbers if load order matters)metadata.json or git commit hashThe templates live in the phaser-tools repository: copy example-makefile.make to Makefile and set PROJECT and PHASER_VERSION.
| Variable | Description | Default |
|---|---|---|
PROJECT |
Project name (used in output filenames) | phaserdemo |
PHASER_VERSION |
Phaser release downloaded from jsDelivr | 3.90.0 |
SRC_DIR |
Directory with the game sources | src |
DIST_DIR |
Directory for exported artifacts | dist |
WEB_DIR |
Directory for the assembled web bundle | dist/web |
VERSION_FILE |
File storing version for CI/CD | .version |
INDEX_HTML_URL |
HTML shell downloaded at build time | phaser-tools web/index.html |
make build
node --check on every file in src/ (syntax check only)make web
phaser.min.js (pinned version) and index.htmlsrc/*.js into dist/web/game.jsmake serve
http://localhost:8000 (Python 3's built-in HTTP server)make export VERSION=1.0.0
VERSION variable.dist/web/ into a versioned ZIP: phaserdemo-1.0.0.html.zipmake watch
src/ (requires fswatch)make clean
dist/ directoryThe tools repository also contains an example-tasks.json that can be copied to .vscode/tasks.json. It provides Serve (make serve, default build task, Cmd+Shift+B), Build Web and Make build.
make ci-versionmetadata.json (if exists) or uses git short commit hashmain or master, prefixes version as dev-<version>-<branch>.versionmake ci-export.version and runs make export with itmake ci-uploadmetadata.json to phaserdemo-<version>.metadata.jsonDROPAREA_SSH_PASSWORD, DROPAREA_PORT, DROPAREA_USER, DROPAREA_HOST, DROPAREA_TARGET_PATHmake ci-update$(UPDATE_SERVER)/update?platform=phaser&name=$(PROJECT)&version=<version>UPDATE_SERVER, UPDATE_SECRET| File | Description |
|---|---|
dist/web/ |
Assembled web bundle (index.html, phaser.min.js, game.js) |
phaserdemo-<version>.html.zip |
Packaged web build, ready for deployment |
make, git, jq, zip, curlnode (for the syntax check)python3 (only for make serve)fswatch (only for watch mode)sshpass and scp (for ci-upload target)This document describes the Woodpecker CI pipeline used to build, package, upload, and publish a Phaser game project.
The pipeline logic is almost entirely encapsulated within the Makefile, which is called by each pipeline step. The pipeline performs the following steps:
make ci-version (alpine) — version from metadata.json or git.make ci-export in the git.teletypegames.org/internal/phaser-builder image (Node + make/zip/curl, built from builder.Dockerfile in phaser-tools) — syntax check, downloads the pinned Phaser runtime and the HTML shell, packages the ZIP.make ci-upload — scp to the droparea (vps.teletype.hu:2223).make ci-update — calls the teletypegames /update endpoint with platform=phaser.Copy example-woodpecker.yaml to .woodpecker.yaml and add the droparea_ssh_password / update_secret_key secrets in Woodpecker.
phaser-demo is the reference project using these templates: an animated "TELETYPE GAMES" wave text (the same demo as ebitengine-demo), built on Phaser 3.90.