add CI/CD pipeline tooling (Makefile, Woodpecker, metadata)
ci/woodpecker/manual/woodpecker Pipeline was successful
ci/woodpecker/manual/woodpecker Pipeline was successful
Adapted from tools_build/phaser-tools for the Vite + TypeScript setup: the web bundle comes from npm ci + npm run build instead of source concatenation, otherwise the standard ci-version/ci-export/ci-upload/ ci-update flow applies (platform=phaser). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,3 +3,6 @@ dist
|
||||
.DS_Store
|
||||
*.local
|
||||
.claude
|
||||
.version
|
||||
*.html.zip
|
||||
*.metadata.json
|
||||
|
||||
Vendored
+28
@@ -0,0 +1,28 @@
|
||||
{
|
||||
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||
// for the documentation about the tasks.json format
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "Serve",
|
||||
"type": "shell",
|
||||
"command": "make serve",
|
||||
"problemMatcher": [],
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "Build Web",
|
||||
"type": "shell",
|
||||
"command": "make web",
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "Make build",
|
||||
"type": "shell",
|
||||
"command": "make build"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
steps:
|
||||
- name: version
|
||||
image: alpine
|
||||
commands:
|
||||
- apk add --no-cache git make jq
|
||||
- make ci-version
|
||||
|
||||
- name: build
|
||||
image: git.teletypegames.org/internal/phaser-builder:latest
|
||||
commands:
|
||||
- make ci-export
|
||||
|
||||
- name: upload
|
||||
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://teletypegames.org
|
||||
UPDATE_SECRET:
|
||||
from_secret: update_secret_key
|
||||
commands:
|
||||
- apk add --no-cache make curl
|
||||
- make ci-update
|
||||
@@ -0,0 +1,75 @@
|
||||
# -----------------------------------------
|
||||
# Makefile – Phaser (Vite + TypeScript) project builder
|
||||
# -----------------------------------------
|
||||
|
||||
PROJECT = trickster-tiles
|
||||
|
||||
DIST_DIR = dist
|
||||
OUTPUT_ZIP = $(PROJECT)-$(VERSION).html.zip
|
||||
|
||||
VERSION_FILE = .version
|
||||
|
||||
all: build
|
||||
|
||||
node_modules: package.json package-lock.json
|
||||
npm ci
|
||||
|
||||
build: node_modules
|
||||
@echo "==> Type-checking + bundling (tsc + vite)"
|
||||
npm run build
|
||||
|
||||
web: build
|
||||
|
||||
serve: node_modules
|
||||
@echo "==> Serving production build on http://localhost:4173"
|
||||
npm run preview
|
||||
|
||||
dev: node_modules
|
||||
npm run dev
|
||||
|
||||
export: web
|
||||
@if [ -z "$(VERSION)" ]; then \
|
||||
echo "ERROR: VERSION not set!"; exit 1; \
|
||||
fi
|
||||
@echo "==> Packaging web build for $(VERSION)"
|
||||
cd $(DIST_DIR) && zip -r ../$(OUTPUT_ZIP) .
|
||||
@echo "==> Cleaning temporary files"
|
||||
rm -rf $(DIST_DIR)
|
||||
|
||||
watch:
|
||||
fswatch -o src | while read; do make build; done
|
||||
|
||||
clean:
|
||||
rm -rf $(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-upload:
|
||||
@VERSION=$$(cat $(VERSION_FILE)); \
|
||||
FILE="$(PROJECT)-$$VERSION.html.zip"; \
|
||||
META_SRC="metadata.json"; \
|
||||
META_DST="$(PROJECT)-$$VERSION.metadata.json"; \
|
||||
cp $$META_SRC $$META_DST; \
|
||||
sshpass -p "$(DROPAREA_SSH_PASSWORD)" scp -o StrictHostKeyChecking=no -P $(DROPAREA_PORT) \
|
||||
$$FILE $$META_DST \
|
||||
$(DROPAREA_USER)@$(DROPAREA_HOST):$(DROPAREA_TARGET_PATH)/
|
||||
|
||||
ci-update:
|
||||
@VERSION=$$(cat $(VERSION_FILE)); \
|
||||
curl "$(UPDATE_SERVER)/update?secret=$(UPDATE_SECRET)&name=$(PROJECT)&platform=phaser&version=$$VERSION"
|
||||
|
||||
.PHONY: all build web serve dev export watch clean ci-version ci-export ci-upload ci-update
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"name": "trickster-tiles",
|
||||
"title": "Trickster Tiles",
|
||||
"author": "Teletype Games",
|
||||
"desc": "A small pixel-art platformer: hop, jump, and outwit moving spikes and disappearing tiles across 10 levels. Made with Phaser 3.",
|
||||
"site": "https://git.teletypegames.org/games/trickster-tiles",
|
||||
"license": "MIT License",
|
||||
"version": "0.1.0"
|
||||
}
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "trickster-tiles",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"version": "0.1.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
Reference in New Issue
Block a user