Use start-sdk's docker-images/<arch>.tar convention
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.
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
*.s9pk
|
*.s9pk
|
||||||
image.tar
|
image.tar
|
||||||
|
docker-images/
|
||||||
scripts/embassy.js
|
scripts/embassy.js
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|||||||
@@ -3,33 +3,77 @@ PKG_VERSION := $(shell yq -r .version manifest.yaml)
|
|||||||
|
|
||||||
TS_FILES := $(shell find ./scripts -name \*.ts 2>/dev/null)
|
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:
|
.DELETE_ON_ERROR:
|
||||||
|
|
||||||
|
# Default: build both arches and verify a universal package.
|
||||||
all: verify
|
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
|
verify: $(PKG_ID).s9pk
|
||||||
start-sdk verify s9pk $(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
|
install: $(PKG_ID).s9pk
|
||||||
start-cli package install $(PKG_ID).s9pk
|
start-cli package install $(PKG_ID).s9pk
|
||||||
|
|
||||||
$(PKG_ID).s9pk: manifest.yaml instructions.md icon.png LICENSE scripts/embassy.js image.tar
|
# ── TypeScript → JS bundle ───────────────────────────────────────────
|
||||||
start-sdk pack
|
|
||||||
|
|
||||||
scripts/embassy.js: $(TS_FILES)
|
scripts/embassy.js: $(TS_FILES)
|
||||||
deno run --allow-read --allow-write --allow-env --allow-net scripts/bundle.ts
|
deno run --allow-read --allow-write --allow-env --allow-net scripts/bundle.ts
|
||||||
|
|
||||||
KAMADO_SRC ?= ../KamadoPool
|
# ── Docker images, one tarball per arch ──────────────────────────────
|
||||||
PLATFORMS ?= linux/arm64/v8,linux/amd64
|
docker-images/x86_64.tar: Dockerfile docker_entrypoint.sh
|
||||||
|
ifneq ($(ARCH),aarch64)
|
||||||
image.tar: Dockerfile docker_entrypoint.sh
|
mkdir -p docker-images
|
||||||
docker buildx build --tag start9/$(PKG_ID)/main:$(PKG_VERSION) \
|
docker buildx build \
|
||||||
--platform=$(PLATFORMS) \
|
--tag start9/$(PKG_ID)/main:$(PKG_VERSION) \
|
||||||
--build-arg ARCH=$(shell uname -m) \
|
--platform linux/amd64 \
|
||||||
|
--build-arg ARCH=x86_64 \
|
||||||
--build-context kamado=$(KAMADO_SRC) \
|
--build-context kamado=$(KAMADO_SRC) \
|
||||||
-o type=oci,dest=image.tar .
|
-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:
|
clean:
|
||||||
|
rm -rf docker-images
|
||||||
rm -f $(PKG_ID).s9pk image.tar scripts/embassy.js
|
rm -f $(PKG_ID).s9pk image.tar scripts/embassy.js
|
||||||
|
|
||||||
.PHONY: all verify install clean
|
.PHONY: all x86 arm verify install clean
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ assets:
|
|||||||
license: LICENSE
|
license: LICENSE
|
||||||
icon: icon.png
|
icon: icon.png
|
||||||
instructions: instructions.md
|
instructions: instructions.md
|
||||||
docker-images: image.tar
|
|
||||||
|
|
||||||
main:
|
main:
|
||||||
type: docker
|
type: docker
|
||||||
|
|||||||
Reference in New Issue
Block a user