binary assets: win-x86/win-x64/linux-x64 targetek + binaries CI step, v1.0.1
ci/woodpecker/push/woodpecker Pipeline failed
ci/woodpecker/push/woodpecker Pipeline failed
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -12,6 +12,13 @@ steps:
|
|||||||
- if grep -q '=> \.\./inkwell' go.mod; then git clone https://git.teletypegames.org/games/inkwell ../inkwell; fi
|
- if grep -q '=> \.\./inkwell' go.mod; then git clone https://git.teletypegames.org/games/inkwell ../inkwell; fi
|
||||||
- make ci-export
|
- make ci-export
|
||||||
|
|
||||||
|
- name: binaries
|
||||||
|
image: git.teletypegames.org/internal/ebitengine-builder:latest
|
||||||
|
commands:
|
||||||
|
# önálló futáshoz is: ha a framework még nincs odaklónozva, pótoljuk
|
||||||
|
- if grep -q '=> \.\./inkwell' go.mod && [ ! -d ../inkwell ]; then git clone https://git.teletypegames.org/games/inkwell ../inkwell; fi
|
||||||
|
- make ci-binaries
|
||||||
|
|
||||||
- name: artifact
|
- name: artifact
|
||||||
image: alpine
|
image: alpine
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
@@ -37,6 +37,43 @@ export: wasm
|
|||||||
@echo "==> Cleaning temporary files"
|
@echo "==> Cleaning temporary files"
|
||||||
rm -f $(DIST_DIR)/$(WASM_NAME) $(DIST_DIR)/wasm_exec.js $(DIST_DIR)/index.html
|
rm -f $(DIST_DIR)/$(WASM_NAME) $(DIST_DIR)/wasm_exec.js $(DIST_DIR)/index.html
|
||||||
|
|
||||||
|
# --- native binaries (lásd: teletypegames/NOTES_BINARY_PLAN.md) -------------
|
||||||
|
# win-x86 / win-x64: pure Go cross-compile (Windowson nem kell cgo)
|
||||||
|
# linux-x64: cgo build, linux/amd64 hoston fut (builder image, X11/GL dev libekkel)
|
||||||
|
BINARY_TARGETS = win-x86 win-x64 linux-x64
|
||||||
|
|
||||||
|
binaries:
|
||||||
|
@if [ -z "$(VERSION)" ]; then \
|
||||||
|
echo "ERROR: VERSION not set!"; exit 1; \
|
||||||
|
fi
|
||||||
|
@for target in $(BINARY_TARGETS); do \
|
||||||
|
$(MAKE) binary-$$target VERSION=$(VERSION) || exit 1; \
|
||||||
|
done
|
||||||
|
|
||||||
|
binary-win-x86:
|
||||||
|
@$(MAKE) binary-build VERSION=$(VERSION) B_GOOS=windows B_GOARCH=386 B_CGO=0 B_EXT=.exe B_TARGET=win-x86
|
||||||
|
|
||||||
|
binary-win-x64:
|
||||||
|
@$(MAKE) binary-build VERSION=$(VERSION) B_GOOS=windows B_GOARCH=amd64 B_CGO=0 B_EXT=.exe B_TARGET=win-x64
|
||||||
|
|
||||||
|
binary-linux-x64:
|
||||||
|
@$(MAKE) binary-build VERSION=$(VERSION) B_GOOS=linux B_GOARCH=amd64 B_CGO=1 B_EXT= B_TARGET=linux-x64
|
||||||
|
|
||||||
|
# belső helper: egy target buildje + zip egyetlen gyökérmappával
|
||||||
|
# (a zipet unixos zip készíti, így a végrehajtási bit megmarad)
|
||||||
|
binary-build:
|
||||||
|
@set -e; \
|
||||||
|
PKG_DIR="$(PROJECT)-$(VERSION)-$(B_TARGET)"; \
|
||||||
|
echo "==> Building $$PKG_DIR"; \
|
||||||
|
rm -rf "$$PKG_DIR" "$$PKG_DIR.zip"; \
|
||||||
|
mkdir -p "$$PKG_DIR"; \
|
||||||
|
CGO_ENABLED=$(B_CGO) GOOS=$(B_GOOS) GOARCH=$(B_GOARCH) go build -o "$$PKG_DIR/$(PROJECT)$(B_EXT)" .; \
|
||||||
|
if [ -f LICENSE ]; then cp LICENSE "$$PKG_DIR/"; fi; \
|
||||||
|
if [ -f README.md ]; then cp README.md "$$PKG_DIR/"; fi; \
|
||||||
|
zip -r "$$PKG_DIR.zip" "$$PKG_DIR" >/dev/null; \
|
||||||
|
rm -rf "$$PKG_DIR"; \
|
||||||
|
echo "==> $$PKG_DIR.zip kesz"
|
||||||
|
|
||||||
watch:
|
watch:
|
||||||
fswatch -o . | while read; do make build; done
|
fswatch -o . | while read; do make build; done
|
||||||
|
|
||||||
@@ -59,18 +96,23 @@ ci-export:
|
|||||||
@VERSION=$$(cat $(VERSION_FILE)); \
|
@VERSION=$$(cat $(VERSION_FILE)); \
|
||||||
$(MAKE) export VERSION=$$VERSION
|
$(MAKE) export VERSION=$$VERSION
|
||||||
|
|
||||||
|
ci-binaries:
|
||||||
|
@VERSION=$$(cat $(VERSION_FILE)); \
|
||||||
|
$(MAKE) binaries VERSION=$$VERSION
|
||||||
|
|
||||||
ci-upload:
|
ci-upload:
|
||||||
@VERSION=$$(cat $(VERSION_FILE)); \
|
@VERSION=$$(cat $(VERSION_FILE)); \
|
||||||
FILE="$(PROJECT)-$$VERSION.html.zip"; \
|
FILE="$(PROJECT)-$$VERSION.html.zip"; \
|
||||||
META_SRC="metadata.json"; \
|
META_SRC="metadata.json"; \
|
||||||
META_DST="$(PROJECT)-$$VERSION.metadata.json"; \
|
META_DST="$(PROJECT)-$$VERSION.metadata.json"; \
|
||||||
|
BINS=$$(ls $(PROJECT)-$$VERSION-*.zip 2>/dev/null || true); \
|
||||||
cp $$META_SRC $$META_DST; \
|
cp $$META_SRC $$META_DST; \
|
||||||
sshpass -p "$(DROPAREA_SSH_PASSWORD)" scp -o StrictHostKeyChecking=no -P $(DROPAREA_PORT) \
|
sshpass -p "$(DROPAREA_SSH_PASSWORD)" scp -o StrictHostKeyChecking=no -P $(DROPAREA_PORT) \
|
||||||
$$FILE $$META_DST \
|
$$FILE $$META_DST $$BINS \
|
||||||
$(DROPAREA_USER)@$(DROPAREA_HOST):$(DROPAREA_TARGET_PATH)/
|
$(DROPAREA_USER)@$(DROPAREA_HOST):$(DROPAREA_TARGET_PATH)/
|
||||||
|
|
||||||
ci-update:
|
ci-update:
|
||||||
@VERSION=$$(cat $(VERSION_FILE)); \
|
@VERSION=$$(cat $(VERSION_FILE)); \
|
||||||
curl "$(UPDATE_SERVER)/update?secret=$(UPDATE_SECRET)&name=$(PROJECT)&platform=ebitengine&version=$$VERSION"
|
curl "$(UPDATE_SERVER)/update?secret=$(UPDATE_SECRET)&name=$(PROJECT)&platform=ebitengine&version=$$VERSION"
|
||||||
|
|
||||||
.PHONY: all build wasm export watch clean ci-version ci-export ci-upload ci-update
|
.PHONY: all build wasm export watch clean binaries binary-win-x86 binary-win-x64 binary-linux-x64 binary-build ci-version ci-export ci-binaries ci-upload ci-update
|
||||||
|
|||||||
+1
-1
@@ -5,5 +5,5 @@
|
|||||||
"desc": "A short point-and-click adventure built on the inkwell framework",
|
"desc": "A short point-and-click adventure built on the inkwell framework",
|
||||||
"site": "https://git.teletypegames.org/games/inkwell-demo",
|
"site": "https://git.teletypegames.org/games/inkwell-demo",
|
||||||
"license": "MIT License",
|
"license": "MIT License",
|
||||||
"version": "1.0.0"
|
"version": "1.0.1"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user