You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.1 KiB

GO_FILES := $(shell find . -iname '*.go' -type f | grep -v /vendor/) # All the .go files, excluding vendor/
BINARY := heartbeet
PLATFORMS := windows linux darwin
VERSION ?= latest
os = $(word 1, $@)
go get -u # Linter
go get -u # Badass static analyzer/linter
# go get # Badass static analyzer/linter
go get -u # Cyclomatic complexity check
go mod download
go test -v -race $(PKGS) # Normal Test
go vet ./... # go vet is the official Go static analyzer
staticcheck ./... # "go vet on steroids" + linter
gocyclo -over 19 $(GO_FILES) # forbid code with huge functions
golint -set_exit_status $(PKGS) # one last linter
mkdir -p release
GOOS=$(os) GOARCH=amd64 go build -o release/$(BINARY)-$(VERSION)-$(os)-amd64
tar -czvf release/$(BINARY)-$(VERSION)-$(os)-amd64.tar.gz -C release/ $(BINARY)-$(VERSION)-$(os)-amd64
.PHONY: release
release: windows linux darwin
rm -rf release/*