pipeline-skeleton

This commit is contained in:
2026-07-16 17:06:47 +02:00
parent 40e21c4d3b
commit d79fd325bf
4 changed files with 104 additions and 2 deletions
+2
View File
@@ -1,2 +1,4 @@
.claude .claude
*.prg *.prg
.version
*-*.metadata.json
+35
View File
@@ -0,0 +1,35 @@
steps:
- name: version
image: alpine
commands:
- 'apk add --no-cache make'
- 'make ci-version'
- name: build
image: debian:stable-slim
commands:
- 'apt-get update && apt-get install -y --no-install-recommends make acme'
- 'make ci-build'
- 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-artifact'
- 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'
+59 -2
View File
@@ -1,12 +1,28 @@
# -----------------------------------------
# Makefile C64 project builder (ACME + VICE)
# -----------------------------------------
PROJECT = c64-demo
ASM = acme ASM = acme
EMU = x64sc EMU = x64sc
SRC = main.asm SRC = main.asm
SRCS = $(wildcard *.asm) SRCS = $(wildcard *.asm)
TARGET = main.prg TARGET = main.prg
METADATA = metadata.json
UNAME_S := $(shell uname -s) UNAME_S := $(shell uname -s)
.PHONY: build run clear rebuild rebuildrun deps # CI/CD variables
VERSION_FILE = .version
DROPAREA_HOST ?= vps.teletype.hu
DROPAREA_PORT ?= 2223
DROPAREA_TARGET_PATH ?= /home/drop
DROPAREA_USER ?= drop
UPDATE_SERVER ?= https://games.vps.teletype.hu
all: build
deps: deps:
ifeq ($(UNAME_S),Darwin) ifeq ($(UNAME_S),Darwin)
@@ -27,8 +43,49 @@ run: build
$(EMU) $(TARGET) $(EMU) $(TARGET)
clear: clear:
rm -f $(TARGET) rm -f $(TARGET) $(PROJECT)-*.prg $(PROJECT)-*.metadata.json $(VERSION_FILE)
rebuild: clear build rebuild: clear build
rebuildrun: clear build run rebuildrun: clear build run
# -----------------------------------------
# CI/CD Pipeline targets
# -----------------------------------------
ci-version:
@VERSION=$$(sed -n 's/.*"version"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' $(METADATA) | head -n 1); \
if [ -z "$$VERSION" ]; then \
echo "ERROR: no \"version\" field in $(METADATA)!"; \
exit 1; \
fi; \
BRANCH=$${CI_COMMIT_BRANCH:-$${WOODPECKER_BRANCH}}; \
BRANCH=$$(echo "$$BRANCH" | tr '/' '-'); \
if [ "$$BRANCH" != "main" ] && [ "$$BRANCH" != "master" ] && [ -n "$$BRANCH" ]; then \
VERSION=dev-$$VERSION-$$BRANCH; \
fi; \
echo "VERSION is: $$VERSION"; \
echo $$VERSION > $(VERSION_FILE)
ci-build: build
@VERSION=$$(cat $(VERSION_FILE)); \
echo "==> Creating versioned files for $$VERSION"; \
cp $(TARGET) $(PROJECT)-$$VERSION.prg; \
cp $(METADATA) $(PROJECT)-$$VERSION.metadata.json; \
ls -lh $(PROJECT)-$$VERSION.*
ci-artifact:
@VERSION=$$(cat $(VERSION_FILE)); \
echo "==> Uploading artifacts for version $$VERSION"; \
SCP_TARGET="$(DROPAREA_USER)@$(DROPAREA_HOST):$(DROPAREA_TARGET_PATH)/"; \
sshpass -p "$(DROPAREA_SSH_PASSWORD)" scp -o StrictHostKeyChecking=no -P $(DROPAREA_PORT) \
$(PROJECT)-$$VERSION.prg \
$(PROJECT)-$$VERSION.metadata.json \
$$SCP_TARGET
ci-update:
@VERSION=$$(cat $(VERSION_FILE)); \
echo "==> Triggering update for version $$VERSION"; \
curl "$(UPDATE_SERVER)/update?secret=$(UPDATE_SECRET)&name=$(PROJECT)&platform=c64&version=$$VERSION"
.PHONY: all deps build run clear rebuild rebuildrun ci-version ci-build ci-artifact ci-update
+8
View File
@@ -0,0 +1,8 @@
{
"name": "c64-demo",
"title": "Teletype Games C64 Demo",
"author": "Teletype Games",
"desc": "A Commodore 64 slide show in 6502 assembly: five slides with per-slide transitions, the TTG logo with a gold color wash, a credits scroller, a parallax starfield with sprites, a typewriter confession slide, and SID music.",
"site": "https://git.teletype.hu/games/c64-demo",
"version": "1.0.0"
}