-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
79 lines (65 loc) · 1.61 KB
/
Taskfile.yml
File metadata and controls
79 lines (65 loc) · 1.61 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# https://taskfile.dev
version: '3'
vars:
BINARY_NAME: protoc-gen-go-json
VERSION:
sh: git describe --tags --always --dirty 2>/dev/null || echo "dev"
COMMIT:
sh: git rev-parse --short HEAD 2>/dev/null || echo "none"
DATE:
sh: date -u '+%Y-%m-%dT%H:%M:%SZ'
LDFLAGS: -s -w -X main.version={{.VERSION}} -X main.commit={{.COMMIT}} -X main.date={{.DATE}}
tasks:
default:
desc: Show available tasks
cmds:
- task --list
build:
desc: Build the binary
cmds:
- go build -ldflags "{{.LDFLAGS}}" -o {{.BINARY_NAME}} .
install:
desc: Install the plugin to $GOPATH/bin
cmds:
- go install -ldflags "{{.LDFLAGS}}" .
clean:
desc: Clean build artifacts
cmds:
- rm -f {{.BINARY_NAME}}
- go clean
test:
desc: Run tests
cmds:
- go test -v ./...
test:coverage:
desc: Run tests with coverage
cmds:
- go test -v -coverprofile=coverage.out ./...
- go tool cover -html=coverage.out -o coverage.html
lint:
desc: Run linter
cmds:
- golangci-lint run ./...
fmt:
desc: Format code
cmds:
- gofmt -s -w .
tidy:
desc: Tidy and verify go modules
cmds:
- go mod tidy
- go mod verify
version:
desc: Show version information
cmds:
- echo "Version {{.VERSION}} (commit {{.COMMIT}}, built at {{.DATE}})"
release:snapshot:
desc: Create a snapshot release (for testing)
cmds:
- goreleaser release --snapshot --clean
proto:gen:
desc: Generate protobuf code for examples
cmds:
- task install
- protobuild vendor
- protobuild gen