-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
23 lines (19 loc) · 771 Bytes
/
Makefile
File metadata and controls
23 lines (19 loc) · 771 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
MODULE := $(shell go list -m)
MODULE_NAME := $(lastword $(subst /, ,$(MODULE)))
GO_BUILD := CGO_ENABLED=0 go build -trimpath
.PHONY: build-linux-amd
build-linux-amd: ## Build linux amd64 binary
GOOS=linux GOARCH=amd64 $(GO_BUILD) -o ./build/linux_x86/ ./...
.PHONY: build-linux-arm
build-linux-arm: ## Build linux arm64 binary
GOOS=linux GOARCH=arm64 $(GO_BUILD) -o ./build/linux_arm64/ ./...
.PHONY: release
release: build-linux-amd build-linux-arm ## Build release tarball
tar -czf ./build/$(MODULE_NAME)_linux_x86.tar.gz -C ./build/linux_x86/ .
tar -czf ./build/$(MODULE_NAME)_linux_arm64.tar.gz -C ./build/linux_arm64/ .
.PHONY: fmt
fmt:
go test ./...
go fmt ./...
golangci-lint fmt --no-config --enable gofmt,goimports
golangci-lint run --no-config --fix