-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
27 lines (19 loc) Β· 1.05 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
BIN_NAME=tu
build-windows:
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "-s -w -X 'github.com/mistweaverco/tu/cmd/tu.VERSION=$(VERSION)'" -o dist/$(BIN_NAME).exe main.go
build-linux:
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "-s -w -X 'github.com/mistweaverco/tu/cmd/tu.VERSION=$(VERSION)'" -o dist/$(BIN_NAME)-linux main.go
build-macos:
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build -ldflags "-s -w -X 'github.com/mistweaverco/tu/cmd/tu.VERSION=$(VERSION)'" -o dist/$(BIN_NAME)-macos main.go
builds: build-linux build-macos build-windows
lint:
golangci-lint run
test:
if [ -n $(COLORS_ENABLED) ] then gotest ./... ; else go test ./...; fi
test-coverage:
go test -race -covermode=atomic -coverprofile=coverage.out ./...
release:
gh release create --generate-notes v$(VERSION) dist/$(BIN_NAME)-linux dist/$(BIN_NAME)-macos dist/$(BIN_NAME).exe
build-and-install-local-debug:
go build -ldflags "-X 'github.com/mistweaverco/tu/cmd/tu.VERSION=development'" -o dist/$(BIN_NAME) main.go
sudo mv dist/$(BIN_NAME) /usr/bin/$(BIN_NAME)