From fe14b2ea4fcc6dc0df1a0cee581060380437a399 Mon Sep 17 00:00:00 2001 From: Joshua Benjamin Date: Sat, 20 Oct 2018 12:09:58 -0700 Subject: [PATCH] (+semver: fix) Compress artifacts (#13) Signed-off-by: Joshua Benjamin --- Makefile | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 34e84ee..1a75ec8 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,9 @@ -BUILD_PATH := artifacts/gogitver -LINUX_BUILD_PATH = $(BUILD_PATH)_linux -LINUX_ARM_BUILD_PATH = $(LINUX_BUILD_PATH)-arm -WINDOWS_BUILD_PATH = $(BUILD_PATH)_windows.exe -MAC_BUILD_PATH = $(BUILD_PATH)_darwin +BUILD_PATH := ./artifacts +LINUX_BUILD_PATH = $(BUILD_PATH)/linux/gogitver +LINUX_ARM_BUILD_PATH = $(BUILD_PATH)/arm/gogitver +WINDOWS_BUILD_PATH = $(BUILD_PATH)/windows/gogitver.exe +MAC_BUILD_PATH = $(BUILD_PATH)/darwin/gogitver + export VERSION=$(shell gogitver) .PHONY: version @@ -19,6 +20,7 @@ test: .PHONY: build build: clean test + mkdir -p artifacts/linux artifacts/arm artifacts/windows artifacts/darwin GOOS=linux GOARCH=amd64 go build -o $(LINUX_BUILD_PATH) cmd/gogitver/main.go GOOS=linux GOARCH=arm go build -o $(LINUX_ARM_BUILD_PATH) cmd/gogitver/main.go GOOS=darwin GOARCH=amd64 go build -o $(MAC_BUILD_PATH) cmd/gogitver/main.go @@ -45,3 +47,8 @@ build-snap: build rm -R ./artifacts/snap package: build-debian-package + cd $(BUILD_PATH)/darwin && tar -zcvf ../darwin.tar.gz * + cd $(BUILD_PATH)/linux && tar -zcvf ../linux.tar.gz * + cd $(BUILD_PATH)/arm && tar -zcvf ../arm.tar.gz * + cd $(BUILD_PATH)/windows && zip -r ../windows.zip * + rm -R $(BUILD_PATH)/darwin $(BUILD_PATH)/linux $(BUILD_PATH)/arm $(BUILD_PATH)/windows