Skip to content

Commit

Permalink
build: packaging binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
alexejk committed Dec 2, 2021
1 parent 4bb8e3d commit ea91740
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ GO_BUILD_CMD=$(GO_FLAGS) go build $(GO_LDFLAGS)
BINARY_NAME=limes
BUILD_DIR=build

APP_VERSION=$(shell hack/version.sh)


.PHONY: docker

all: clean generate-all lint test build-all
all: clean generate-all lint test build-all package-all

lint:
@echo "Linting code..."
Expand Down Expand Up @@ -39,6 +42,20 @@ build-osx: pre-build
GOOS=darwin GOARCH=arm64 $(GO_BUILD_CMD) -o $(BUILD_DIR)/$(BINARY_NAME)-darwin-arm64
build build-all: build-linux build-osx

.PHONY: package-linux
package-linux:
@echo "Packaging Linux binary..."
tar -C $(BUILD_DIR) -zcf $(BUILD_DIR)/$(BINARY_NAME)-$(APP_VERSION)-linux-amd64.tar.gz $(BINARY_NAME)-linux-amd64

.PHONY: package-osx
package-osx:
@echo "Packaging OSX binaries..."
tar -C $(BUILD_DIR) -zcf $(BUILD_DIR)/$(BINARY_NAME)-$(APP_VERSION)-darwin-amd64.tar.gz $(BINARY_NAME)-darwin-amd64
tar -C $(BUILD_DIR) -zcf $(BUILD_DIR)/$(BINARY_NAME)-$(APP_VERSION)-darwin-arm64.tar.gz $(BINARY_NAME)-darwin-arm64

.PHONY: package-all
package-all: package-linux package-osx

clean:
@echo "Cleaning..."
@rm -Rf $(BUILD_DIR)
Expand Down

0 comments on commit ea91740

Please sign in to comment.