update-grpc-tmpl/Taskfile.yml

48 lines
1.6 KiB
YAML

---
version: "3"
tasks:
default:
- task: all
all:
- task: checkformat
- task: getdeps
- task: protos
- task: gorelease
checkformat:
desc: check if formatting is good
cmds:
- diff -u <(echo -n) <(gofmt -d ./)
ignore_errors: false
getdeps:
desc: download dependencies
cmds:
- type protoc
- GO111MODULE=on go install -v google.golang.org/protobuf/cmd/protoc-gen-go@latest
- GO111MODULE=on go install -v google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
- GO111MODULE=on go install -v github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@latest
- GO111MODULE=on go install -v github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@latest
ignore_errors: false
protos:
desc: generate go files from protobuf definitions
cmds:
- buf generate --timeout=5m30s
ignore_errors: false
protoc-protos:
desc: obsolete codegen from protobuf definitions
cmds:
- protoc -I ./proto/ -I third_party/googleapis -I third_party/grpc-gateway --go_out=./proto --go_opt=paths=source_relative --go-grpc_out=./proto --go-grpc_opt=paths=source_relative --openapiv2_out=./openapiv2 --openapiv2_opt=logtostderr=true --grpc-gateway_out=./proto --grpc-gateway_opt=logtostderr=true --grpc-gateway_opt=paths=source_relative --grpc-gateway_opt=generate_unbound_methods=true proto/v1/*.proto
ignore_errors: false
gorelease:
desc: run gorelease
cmds:
- go install -v github.com/goreleaser/goreleaser@latest
- goreleaser --snapshot --skip-publish --rm-dist
ignore_errors: false