commit 258cc2e7bae87efda43070db6606c07177cc337f Author: Zsolt Tasnadi Date: Sat Feb 28 11:58:11 2026 +0100 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..03a0a40 --- /dev/null +++ b/.gitignore @@ -0,0 +1,22 @@ +# Build output +bin/ +dist/ +*.zip +*.love +*.metadata.json + +# Version file +.version + +# OS +.DS_Store +Thumbs.db + +# Editor +.vscode/ +.idea/ +*.swp +*.swo + +# Lua +luac.out diff --git a/.woodpecker.yaml b/.woodpecker.yaml new file mode 100644 index 0000000..6d72166 --- /dev/null +++ b/.woodpecker.yaml @@ -0,0 +1,35 @@ +steps: + - name: version + image: alpine + commands: + - apk add --no-cache git make jq + - make ci-version + + - name: build + image: alpine + commands: + - apk add --no-cache zip make + - 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 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5f2f68e --- /dev/null +++ b/Makefile @@ -0,0 +1,79 @@ +# ----------------------------------------- +# Makefile – Love2D project builder +# ----------------------------------------- + +PROJECT = love2ddemo + +BIN_DIR = bin +DIST_DIR = dist +LOVE_NAME = $(PROJECT).love +OUTPUT_LOVE = $(DIST_DIR)/$(LOVE_NAME) +OUTPUT_ZIP = $(PROJECT)-$(VERSION).love.zip + +VERSION_FILE = .version + +all: build + +build: + @mkdir -p $(BIN_DIR) + @echo "==> Checking Love2D syntax" + luac -p *.lua 2>/dev/null || true + +love: + @mkdir -p $(DIST_DIR) + @echo "==> Building .love package" + zip -r $(OUTPUT_LOVE) . \ + --exclude "*.git*" \ + --exclude "$(BIN_DIR)/*" \ + --exclude "$(DIST_DIR)/*" \ + --exclude "Makefile" \ + --exclude ".version" \ + --exclude "metadata.json" \ + --exclude "*.zip" + +export: love + @if [ -z "$(VERSION)" ]; then \ + echo "ERROR: VERSION not set!"; exit 1; \ + fi + @echo "==> Packaging Love2D for $(VERSION)" + zip -r $(OUTPUT_ZIP) $(OUTPUT_LOVE) + @echo "==> Cleaning temporary files" + rm -f $(OUTPUT_LOVE) + +watch: + fswatch -o . --include="\.lua$$" | while read; do make build; done + +clean: + rm -rf $(BIN_DIR) $(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.love.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=love2d&version=$$VERSION" + +.PHONY: all build love export watch clean ci-version ci-export ci-upload ci-update diff --git a/conf.lua b/conf.lua new file mode 100644 index 0000000..ca2cd45 --- /dev/null +++ b/conf.lua @@ -0,0 +1,9 @@ +-- conf.lua + +function love.conf(t) + t.identity = "teletype-games" + t.version = "11.5" -- minimálisan szükséges Love2D verzió + t.window.title = "Teletype Games" + t.window.width = 800 + t.window.height = 600 +end diff --git a/main.lua b/main.lua new file mode 100644 index 0000000..15d112b --- /dev/null +++ b/main.lua @@ -0,0 +1,9 @@ +-- main.lua + +function love.load() + love.window.setTitle("Teletype Games") +end + +function love.draw() + love.graphics.printf("Teletype Games", 0, love.graphics.getHeight() / 2 - 12, love.graphics.getWidth(), "center") +end