-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
79 lines (69 loc) · 1.86 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
version: "3"
set: [errexit, nounset, pipefail]
shopt: [globstar]
includes:
lint:
taskfile: https://github.com/nikaro/meta/raw/tasks-v1/taskfiles/lint.yml
internal: true
format:
taskfile: https://github.com/nikaro/meta/raw/tasks-v1/taskfiles/format.yml
internal: true
go:
taskfile: https://github.com/nikaro/meta/raw/tasks-v1/taskfiles/go.yml
vars:
BUILD_TARGETS:
- linux/amd64
- linux/arm64
- darwin/amd64
- darwin/arm64
- windows/amd64
- windows/arm64
env:
APP: zabbixmon
PREFIX:
sh: echo ${PREFIX:-/usr/local}
BINDIR:
sh: echo ${BINDIR:-${PREFIX:-/usr/local}/bin}
MANDIR:
sh: echo ${MANDIR:-${PREFIX:-/usr/local}/share/man}
SHAREDIR:
sh: echo ${SHAREDIR:-${PREFIX:-/usr/local}/share/${APP:-zabbixmon}}
tasks:
init:
desc: Initialize repositry
cmds:
- git config core.hooksPath .githooks
- git config commit.template .gitmessage
lint:
desc: Run linters
cmds:
- task: lint:default
- task: go:lint
format:
desc: Run formatters
cmds:
- task: format:default
- task: go:format
bump:
desc: Bump version
preconditions:
- cz --no-raise 3,21 bump --dry-run --changelog --changelog-to-stdout > ./_changelog.md
cmd: cz --no-raise 3,21 bump --changelog --changelog-to-stdout > ./_changelog.md
release:
desc: Publish release
preconditions:
- test -n "$AUR_KEY"
- test -n "$GITHUB_TOKEN"
cmds:
- goreleaser release --clean --release-notes ./_changelog.md
- defer: rm -rf _changelog.md
install:
desc: Install the application
deps: ["go:build"]
cmds:
- install -Dm755 ./build/${APP}-${GOOS}-${GOARCH} ${BINDIR}/${APP}
uninstall:
desc: Uninstall the application
cmds:
- rm -rf ${BINDIR}/${APP}
- rmdir --ignore-fail-on-non-empty ${BINDIR}