From fcbe9fbf59a6e95e6788d28e4dd27477bcb17f15 Mon Sep 17 00:00:00 2001 From: Zsolt Tasnadi Date: Mon, 26 Jan 2026 21:18:14 +0100 Subject: [PATCH] pipeline fix --- .woodpecker.yml | 16 +++++++++------- Makefile | 7 +++---- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index fcc19b2..05c9462 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -6,9 +6,10 @@ steps: - name: version image: alpine commands: - - "VERSION=$(sed -n 's/^-- version: //p' $GAME_NAME.$GAME_LANG | head -n 1)" + - "VERSION=$(sed -n 's/^-- version: //p' $GAME_NAME.$GAME_LANG | head -n 1 | tr -d '[:space:]')" + - "echo VERSION is: $VERSION" - "echo $VERSION > .version" - - "echo Detected version: $VERSION" + - "cat .version" - name: build image: git.teletype.hu/internal/tic80pro:latest @@ -17,9 +18,10 @@ steps: XDG_RUNTIME_DIR: /tmp commands: - "apt-get update && apt-get install -y zip" - - "VERSION=$(cat .version)" - - "echo Building version $VERSION" - - "make build VERSION=$VERSION" + - "cat .version" + - "export VERSION=$(cat .version)" + - "echo Building version: $VERSION" + - "make build" - "make export VERSION=$VERSION" - "echo Generated files:" - "ls -lh $GAME_NAME-*.* $GAME_NAME.tic $GAME_NAME.html.zip" @@ -37,7 +39,7 @@ steps: commands: - "apk add --no-cache openssh-client sshpass" - "mkdir -p /root/.ssh" - - "VERSION=$(cat .version)" + - "export VERSION=$(cat .version)" - "echo VERSION artifact step: $VERSION" - "echo SCP Target Path: $DROPAREA_TARGET_PATH/$GAME_NAME/$VERSION/" - "sshpass -p $DROPAREA_SSH_PASSWORD ssh -p $DROPAREA_PORT -o StrictHostKeyChecking=no $DROPAREA_USER@$DROPAREA_HOST mkdir -p $DROPAREA_TARGET_PATH/$GAME_NAME/$VERSION" @@ -55,6 +57,6 @@ steps: from_secret: update_secret_key commands: - "apk add --no-cache curl" - - "VERSION=$(cat .version)" + - "export VERSION=$(cat .version)" - "echo Triggering update for version $VERSION" - "curl $UPDATE_SERVER/update?secret=$UPDATE_SECRET&name=$GAME_NAME&platform=tic80&version=$VERSION" \ No newline at end of file diff --git a/Makefile b/Makefile index 96c24ce..330c5ec 100644 --- a/Makefile +++ b/Makefile @@ -14,9 +14,6 @@ SRC = $(shell sed 's|^|$(SRC_DIR)/|' $(ORDER)) ASSETS_LUA = inc/meta/meta.assets.lua -# VERSION lehet környezeti változó vagy extract-eljük a lua fájlból -VERSION ?= $(shell sed -n "s/^-- version: //p" $(OUTPUT) | head -n 1) - all: build build: $(OUTPUT) @@ -37,7 +34,9 @@ export: build @tic80 --cli --skip --fs=. \ --cmd="load $(OUTPUT) & save $(PROJECT)-$(VERSION) & export html $(PROJECT)-$(VERSION).html & exit" @echo "==> Creating versioned files" - @cp $(PROJECT)-$(VERSION).tic $(PROJECT).tic + @if [ -f "$(PROJECT)-$(VERSION).tic" ]; then \ + cp $(PROJECT)-$(VERSION).tic $(PROJECT).tic; \ + fi @if [ -f "$(PROJECT)-$(VERSION).html.zip" ]; then \ cp $(PROJECT)-$(VERSION).html.zip $(PROJECT).html.zip; \ fi