-
Notifications
You must be signed in to change notification settings - Fork 2
/
Taskfile.yaml
198 lines (173 loc) · 4.27 KB
/
Taskfile.yaml
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# https://taskfile.dev
version: '3'
vars:
REPO_NAME: go-git-mob
REPO_OWNER: davidalpert
CMD_NAME: git-mob
CURRENT_VERSION:
sh: sbot get version
VERSION: '{{ .NEXT_VERSION | default .CURRENT_VERSION }}'
tasks:
default:
deps:
- help
silent: true
cit:
desc: CI task; cleans, run tests, and builds
deps:
- clean
- vale
- build
- test
- features
clean:
desc: clean built output
cmds:
- rm -rf ./bin
- rm -rf ./aruba
doctor:
desc: run doctor.sh to sort out development dependencies
cmds:
- ./.tools/doctor.sh
# guard:
# desc: run guard to watch
# cmds:
# - bundle exec guard
gen:
desc: run code-generation
run: once
cmds:
- go run ./.tools/version_gen.go {{ .CMD_NAME }}
env:
VERSION: "{{ .VERSION }}"
status:
# - grep "\"{{ .VERSION }}\"" internal/version/detail.go
- '[[ -n $SKIP_GEN ]]'
bundle:
desc: install ruby gems
run: once
cmds:
- bundle --quiet
vale:
desc: run linting rules against markdown files
run: once
cmds:
- vale README.md CONTRIBUTING.md # we don't valedate CHANGELOG.md as that reflects historical commit summaries
status:
- '[[ "$GITHUB_ACTIONS" -neq "true" ]]'
test:
desc: run tests
run: once
deps:
- gen
cmds:
- go test ./...
silent: true
autotest:
desc: run tests continuously using goconvey's test UI
deps:
- gen
cmds:
- goconvey
silent: true
features:
desc: run acceptance tests
deps:
- bundle
- test
cmds:
- task: build
- bundle exec cucumber --publish-quiet --tags 'not @wip' --tags 'not @ignore'
features-wip:
desc: run wip acceptance tests
deps:
- bundle
- test
cmds:
- task: build
- bundle exec cucumber --publish-quiet --tags '@wip' --tags 'not @ignore'
build:
desc: build
run: once
deps:
- gen
cmds:
- task: test
- mkdir -p ./bin
- go build -o ./bin/{{ .CMD_NAME }} ./cmd/{{ .CMD_NAME }}
install:
desc: install go-git-mob from local source into GOPATH
run: once
deps:
- build
cmds:
- 'echo "writing: ${GOPATH}/bin/git-mob"'
- 'cp ./bin/git-mob ${GOPATH}/bin/'
- '${GOPATH}/bin/git-mob install'
preconditions:
- '[[ -n ${GOPATH} ]]'
- test -d ${GOPATH}/bin
uninstall:
desc: uninstall go-git-mob from GOPATH
run: once
cmds:
- 'echo "uninstalling: ${GIT_MOB_BIN}"'
- '${GIT_MOB_BIN} uninstall'
env:
GIT_MOB_BIN:
sh: which git-mob
precondition:
- test -f ${GIT_MOB_BIN}
changelog:
desc: generate/update CHANGELOG.md
cmds:
- git-chglog --output CHANGELOG.md
preview-release-notes:
desc: preview release notes (generates RELEASE_NOTES.md)
cmds:
- git-chglog --output RELEASE_NOTES.md --template .chglog/RELEASE_NOTES.tpl.md "v{{ .VERSION }}"
release:
cmds:
- task: gen
vars:
VERSION: "{{ .NEXT_VERSION }}"
# - task: features
- git add -f internal/version/detail.go
- git-chglog --next-tag v{{ .NEXT_VERSION }} --output CHANGELOG.md
- git add -f CHANGELOG.md
- git commit --message "release notes for v{{ .NEXT_VERSION }}"
- sbot release version --mode {{ .BUMP_TYPE }}
- git show --no-patch --format=short v{{ .NEXT_VERSION }}
preconditions:
- sh: git diff-files --quiet
msg: There are unstaged changes; clean your working directory before releasing.
- sh: git diff-index --quiet --cached HEAD --
msg: There are uncomitted changes; clean your working directory before releasing.
vars:
NEXT_VERSION:
sh: sbot predict version --mode {{ .BUMP_TYPE }}
release-patch:
desc: release a patch update
cmds:
- task: release
vars:
BUMP_TYPE: patch
release-minor:
desc: release a minor update
cmds:
- task: release
vars:
BUMP_TYPE: minor
release-major:
desc: release a major update
cmds:
- task: release
vars:
BUMP_TYPE: major
help:
desc: list targets
cmds:
- echo "{{ .CMD_NAME}} v{{ .VERSION }}"
- echo ""
- task --list
silent: true