-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (25 loc) Β· 1.46 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
27
28
29
30
31
32
33
34
35
BIN_NAME=caline
build-windows:
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "-s -w -X 'github.com/mistweaverco/caline/cmd/caline.VERSION=$(VERSION)'" -o dist/windows/$(BIN_NAME).exe main.go
build-linux:
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "-s -w -X 'github.com/mistweaverco/caline/cmd/caline.VERSION=$(VERSION)'" -o dist/linux/$(BIN_NAME)-linux main.go
build-macos:
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build -ldflags "-s -w -X 'github.com/mistweaverco/caline/cmd/caline.VERSION=$(VERSION)'" -o dist/macos/$(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/linux/$(BIN_NAME)-linux dist/macos/$(BIN_NAME)-macos dist/windows/$(BIN_NAME).exe
build-and-install-local-debug:
go build -ldflags "-X 'github.com/mistweaverco/caline/cmd/caline.VERSION=development'" -o dist/$(BIN_NAME) main.go
sudo mv dist/$(BIN_NAME) /usr/bin/$(BIN_NAME)
run:
go run -ldflags "-X 'github.com/mistweaverco/caline/cmd/caline.VERSION=development'" main.go
run-check:
go run -ldflags "-X 'github.com/mistweaverco/caline/cmd/caline.VERSION=development'" main.go --check
run-check-verbose:
go run -ldflags "-X 'github.com/mistweaverco/caline/cmd/caline.VERSION=development'" main.go --check --verbose