From 4839c71176ac48efa2d8d94034ff68212a7b3327 Mon Sep 17 00:00:00 2001 From: Denis Baryshev Date: Sat, 11 Jan 2025 16:39:42 +0700 Subject: [PATCH] chore: add single arch support Signed-off-by: Denis Baryshev --- .github/workflows/verify.yml | 1 - Makefile | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index ba0f30f..5975176 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -30,4 +30,3 @@ jobs: - name: Build multi-arch images and binaries run: make clean multiarch-tar - diff --git a/Makefile b/Makefile index e341670..672a1bc 100644 --- a/Makefile +++ b/Makefile @@ -22,6 +22,7 @@ BATS_TEST ?= test DOCKER ?= docker export DOCKER PLATFORM ?= linux/amd64 +PLATFORM_ARCH = $(subst /,-,$(ARCH)) ARCH = $(shell echo "$(PLATFORM)" | sed -E 's!linux/([^/]+).*!\1!') IMAGE_EXPORT_DIR = $(BUILD_DIR)/images/$@ BUILDX_BUILDER ?= podman-builder @@ -40,6 +41,11 @@ multiarch-tar: BUILDX_OUTPUT = type=local,dest=$(IMAGE_EXPORT_DIR) multiarch-tar: TAR_TARGET ?= tar multiarch-tar: images tar-all +# Single arch builds don't have nested arch directory, thus set path as for multiarch +singlearch-tar: $(PLATFORM_ARCH)-tar +$(PLATFORM_ARCH)-tar: BUILDX_OUTPUT = type=local,dest=$(IMAGE_EXPORT_DIR)/linux_$(ARCH) +$(PLATFORM_ARCH)-tar: images tar + multiarch-images: BUILDX_OUTPUT = type=image multiarch-images: images