-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yaml
39 lines (36 loc) · 1.06 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
---
version: 3
vars:
PROJECT_NAME:
sh: echo ${PWD##*/}
PROTO_DIR:
sh: find . -type f -name "*.proto" -exec dirname {} \; | sort | uniq
BRANCH:
sh: if [ $(git rev-parse --abbrev-ref HEAD) != "main" ]; then echo $(git rev-parse --abbrev-ref HEAD); else echo main ; fi
tasks:
proto:
desc: Generate Go code from proto
cmds:
- protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative {{ .PROTO_DIR }}/*.proto
lint:
desc: Lint Golang
cmds:
- cmd: golangci-lint run
ignore_error: true
commit:
desc: Commit + push code into branch
cmds:
- rm -rf dist/
- git branch --set-upstream-to=origin/{{ .BRANCH }}
- git pull
- |
git add *
if [[ -n $(git status --porcelain) ]]; then
echo "ENTER COMMIT MESSAGE"
read COMMIT_MESSAGE;
echo "COMMITTING CHANGES"
git commit --allow-empty -a -m "$(echo ${COMMIT_MESSAGE})"
else
echo "NO CHANGES"
fi
git push origin -u {{ .BRANCH }}