-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (52 loc) · 1.58 KB
/
Makefile
File metadata and controls
65 lines (52 loc) · 1.58 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
.PHONY: build install clean test lint run help
# Variables
BINARY_NAME=gitscrum
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=-ldflags "-X main.version=$(VERSION) -X main.commit=$(COMMIT) -X main.date=$(DATE)"
# Default target
all: build
## build: Build the CLI binary
build:
go build $(LDFLAGS) -o bin/$(BINARY_NAME) ./cmd/gitscrum
## install: Install the CLI to $GOPATH/bin
install:
go install $(LDFLAGS) ./cmd/gitscrum
## run: Run the CLI
run:
go run $(LDFLAGS) ./cmd/gitscrum $(ARGS)
## test: Run tests
test:
go test -v -race -cover ./...
## lint: Run linter
lint:
golangci-lint run ./...
## clean: Clean build artifacts
clean:
rm -rf bin/
rm -rf dist/
## deps: Download dependencies
deps:
go mod download
go mod tidy
## completion: Generate shell completions
completion:
@mkdir -p completions
go run ./cmd/gitscrum completion bash > completions/gitscrum.bash
go run ./cmd/gitscrum completion zsh > completions/_gitscrum
go run ./cmd/gitscrum completion fish > completions/gitscrum.fish
go run ./cmd/gitscrum completion powershell > completions/gitscrum.ps1
## release: Create a new release (requires goreleaser)
release:
goreleaser release --clean
## snapshot: Create a snapshot release (for testing)
snapshot:
goreleaser release --snapshot --clean
## help: Show this help message
help:
@echo "GitScrum CLI - Development Commands"
@echo ""
@echo "Usage: make <target>"
@echo ""
@grep -E '^##' Makefile | sed 's/## / /'