From 531da9eeb208fdec501e26170055e143aaa3204a Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Thu, 14 Jul 2022 13:52:07 +0300 Subject: [PATCH] [#18] Support macOS builds Signed-off-by: Alex Vanin --- Makefile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8dafff8..12e31ee 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,16 @@ HUB_TAG ?= "$(shell echo ${VERSION} | sed 's/^v//')" DOCKER_LIST_VERSION ?= v1.42 SWAGGER_VERSION ?= v0.29.0 -SWAGGER_ARCH ?= linux_amd64 + +UNAME = "$(shell uname)/$(shell uname -m)" +SWAGGER_ARCH = linux_amd64 + +ifeq ($(UNAME), "Darwin/arm64") + SWAGGER_ARCH = darwin_arm64 +endif +ifeq ($(UNAME), "Darwin/x86_64") + SWAGGER_ARCH = darwin_amd64 +endif SWAGGER_URL = "$(shell curl -s https://api.github.com/repos/go-swagger/go-swagger/releases/tags/$(SWAGGER_VERSION) | \ jq -r '.assets[] | select(.name | contains("swagger_$(SWAGGER_ARCH)")) | .browser_download_url')"