start-sdk pack discovers per-arch tarballs at docker-images/ x86_64.tar and docker-images/aarch64.tar by filename convention, not via a manifest assets entry. Dropping the invalid 'docker-images: image.tar' assets key and reworking the Makefile to build one type=docker tarball per arch with arm/x86 single- arch convenience targets.
80 lines
2.6 KiB
Makefile
80 lines
2.6 KiB
Makefile
PKG_ID := $(shell yq -r .id manifest.yaml)
|
|
PKG_VERSION := $(shell yq -r .version manifest.yaml)
|
|
|
|
TS_FILES := $(shell find ./scripts -name \*.ts 2>/dev/null)
|
|
|
|
# Where KamadoPool source lives (buildx passes it as a named context).
|
|
KAMADO_SRC ?= ../KamadoPool
|
|
|
|
.DELETE_ON_ERROR:
|
|
|
|
# Default: build both arches and verify a universal package.
|
|
all: verify
|
|
|
|
# Single-arch convenience targets — much faster if you don't have
|
|
# qemu-user-static registered for cross-arch emulation.
|
|
x86: ARCH = x86_64
|
|
x86:
|
|
@rm -f docker-images/aarch64.tar
|
|
$(MAKE) ARCH=x86_64
|
|
|
|
arm: ARCH = aarch64
|
|
arm:
|
|
@rm -f docker-images/x86_64.tar
|
|
$(MAKE) ARCH=aarch64
|
|
|
|
verify: $(PKG_ID).s9pk
|
|
start-sdk verify s9pk $(PKG_ID).s9pk
|
|
@echo "Package: $(PKG_ID).s9pk ($(shell du -h $(PKG_ID).s9pk | cut -f1))"
|
|
|
|
install: $(PKG_ID).s9pk
|
|
start-cli package install $(PKG_ID).s9pk
|
|
|
|
# ── TypeScript → JS bundle ───────────────────────────────────────────
|
|
scripts/embassy.js: $(TS_FILES)
|
|
deno run --allow-read --allow-write --allow-env --allow-net scripts/bundle.ts
|
|
|
|
# ── Docker images, one tarball per arch ──────────────────────────────
|
|
docker-images/x86_64.tar: Dockerfile docker_entrypoint.sh
|
|
ifneq ($(ARCH),aarch64)
|
|
mkdir -p docker-images
|
|
docker buildx build \
|
|
--tag start9/$(PKG_ID)/main:$(PKG_VERSION) \
|
|
--platform linux/amd64 \
|
|
--build-arg ARCH=x86_64 \
|
|
--build-context kamado=$(KAMADO_SRC) \
|
|
-o type=docker,dest=docker-images/x86_64.tar \
|
|
.
|
|
endif
|
|
|
|
docker-images/aarch64.tar: Dockerfile docker_entrypoint.sh
|
|
ifneq ($(ARCH),x86_64)
|
|
mkdir -p docker-images
|
|
docker buildx build \
|
|
--tag start9/$(PKG_ID)/main:$(PKG_VERSION) \
|
|
--platform linux/arm64 \
|
|
--build-arg ARCH=aarch64 \
|
|
--build-context kamado=$(KAMADO_SRC) \
|
|
-o type=docker,dest=docker-images/aarch64.tar \
|
|
.
|
|
endif
|
|
|
|
# ── Pack ─────────────────────────────────────────────────────────────
|
|
$(PKG_ID).s9pk: manifest.yaml instructions.md icon.png LICENSE \
|
|
scripts/embassy.js \
|
|
docker-images/x86_64.tar docker-images/aarch64.tar
|
|
ifeq ($(ARCH),x86_64)
|
|
@echo "start-sdk: packing x86_64 only"
|
|
else ifeq ($(ARCH),aarch64)
|
|
@echo "start-sdk: packing aarch64 only"
|
|
else
|
|
@echo "start-sdk: packing universal (x86_64 + aarch64)"
|
|
endif
|
|
start-sdk pack
|
|
|
|
clean:
|
|
rm -rf docker-images
|
|
rm -f $(PKG_ID).s9pk image.tar scripts/embassy.js
|
|
|
|
.PHONY: all x86 arm verify install clean
|