-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathTaskfile.yml
83 lines (73 loc) · 2.22 KB
/
Taskfile.yml
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
80
81
82
83
# https://taskfile.dev
version: '2'
vars:
Product: 'ardan'
tasks:
default:
cmds:
- echo "{{.Product}}"
- task: run
desc: default task(run)
silent: true
run:
desc: go run
deps: [res]
cmds:
- echo "go run"
- go run main.go
silent: true
res:
desc: embed files
cmds:
- echo "res generating..."
- statik -src=./templates -include=*.* -p=res -f
- echo "res generated."
silent: true
release:
desc: "release"
deps: [res]
cmds:
- echo "release generating..."
- go build -ldflags "-w -s -X github.com/teamlint/ardan/version.Version={{.GitCommit}}" -o ./release/{{.Product}}_{{.GitCommit}} ./main.go
- echo "release {{.Product}}_{{.GitCommit}}."
vars:
GitCommit:
sh: git describe --always --tags --dirty
silent: true
github:
desc: "github release"
deps: [res]
cmds:
- echo "github release generating..."
- GOOS=darwin GOARCH=amd64 go build -ldflags "-w -s -X github.com/teamlint/ardan/version.Version={{.GitCommit}}" -o ./release/{{.Product}}_{{.GitCommit}}_mac ./main.go
- GOOS=linux GOARCH=amd64 go build -ldflags "-w -s -X github.com/teamlint/ardan/version.Version={{.GitCommit}}" -o ./release/{{.Product}}_{{.GitCommit}}_linux ./main.go
- GOOS=windows GOARCH=amd64 go build -ldflags "-w -s -X github.com/teamlint/ardan/version.Version={{.GitCommit}}" -o ./release/{{.Product}}_{{.GitCommit}}_windows.exe ./main.go
- echo "github release {{.Product}}_{{.GitCommit}}."
vars:
GitCommit:
sh: git describe --always --tags
silent: true
version:
desc: "version"
cmds:
- echo "current version:"
- git describe --always --tags --dirty
silent: true
install:
desc: "install"
deps: [res]
cmds:
- echo "{{.Product}} install..."
- go install -ldflags "-w -s -X github.com/teamlint/ardan/version.Version={{.GitCommit}}"
- echo "{{.Product}} {{.GitCommit}} is installed."
vars:
GitCommit:
sh: git describe --always --tags --dirty
silent: true
clean:
desc: "clean release files"
cmds:
- echo "cleaning..."
- rm -rf ./release
- echo "clean done."
silent: true