-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (27 loc) · 806 Bytes
/
Makefile
File metadata and controls
37 lines (27 loc) · 806 Bytes
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
36
37
MODULE := github.com/jhuiting/chargebee-cli
BINARY := cb
BUILD_DIR := bin
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo none)
DATE ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
LDFLAGS := -s -w \
-X $(MODULE)/internal/version.Version=$(VERSION) \
-X $(MODULE)/internal/version.Commit=$(COMMIT) \
-X $(MODULE)/internal/version.Date=$(DATE)
.PHONY: build lint fmt verify test deps clean
build:
@go build -ldflags '$(LDFLAGS)' -o $(BUILD_DIR)/$(BINARY) ./cmd/cb
lint:
@golangci-lint run
fmt:
@go fmt ./...
@goimports -w -local $(MODULE) .
verify: fmt lint build
@echo "✅ Code verification complete"
test:
@go test -v ./...
deps:
@go mod download
@go mod tidy
clean:
@rm -rf $(BUILD_DIR)