-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
44 lines (35 loc) · 715 Bytes
/
Copy pathTaskfile.yml
File metadata and controls
44 lines (35 loc) · 715 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
38
39
40
41
42
43
44
version: '3'
vars:
BINARY: dman
tasks:
tidy:
cmds:
- go fmt ./...
- go mod tidy
test:
cmds:
- go test --cover ./...
- go mod verify
lint:
cmds:
- go vet ./...
- golangci-lint run ./...
build:
vars:
VERSION:
sh: git describe --tags --match "v*" --abbrev=0 2>/dev/null || echo "dev"
cmds:
- go mod verify
- go build -ldflags "-s -w -X main.Version={{.VERSION}}" -o bin/{{.BINARY}} .
- chmod +x bin/{{.BINARY}}
run:
cmds:
- task: build
- ./bin/{{.BINARY}}
clean:
cmds:
- rm -rf bin
install:
cmds:
- task: build
- cp ./bin/{{.BINARY}} $HOME/.local/bin/{{.BINARY}}