Skip to content

Commit

Permalink
(+semver: fix) Compress artifacts (#13)
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Benjamin <[email protected]>
  • Loading branch information
annymsMthd authored Oct 20, 2018
1 parent f1b2729 commit fe14b2e
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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

0 comments on commit fe14b2e

Please sign in to comment.