-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yaml
37 lines (33 loc) · 1016 Bytes
/
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
---
version: "3"
vars:
PROJECT_NAME:
sh: pwd | grep -o "[^/]*$"
DATE:
sh: date +"%y.%m%d.%H%M"
tasks:
lint:
desc: Lint code
cmds:
- cmd: golangci-lint run
ignore_error: true
test:
desc: Test code
cmds:
- cmd: go test -v
tag:
desc: commit, push & tag the module
deps: [lint, test]
cmds:
- go mod tidy
- git pull
- git add *
- git commit -am 'updated {{ .PROJECT_NAME }} {{ .DATE }} for tag version {{ .UPDATED_TAG_VERSION }}'
- git push
- git tag -a {{ .UPDATED_TAG_VERSION }} -m 'updated for stuttgart-things {{.DATE}} for tag version {{ .UPDATED_TAG_VERSION }}'
- git push origin --tags
vars:
UPDATED_TAG:
sh: old_tag=$(git describe --tags --abbrev=0 | cut -d "." -f3); new_tag=$((old_tag+1)); echo $new_tag
UPDATED_TAG_VERSION:
sh: t1=$(git describe --tags --abbrev=0 | cut -f1 -d'.'); t2=$(git describe --tags --abbrev=0 | cut -f2 -d'.'); echo $t1.$t2.{{.UPDATED_TAG}}