An opinionated test repo for fun with monorepos using Go and Bazel!
- Go packages reside at the root of the repo, and Bazel is used to build and test them.
- The
apps
directory contains Go applications that depend on the packages in the root of the repo.- Apps could include services, CLI tools, etc. but should produce a binary or container image.
brew install bazelisk go golangci-lint
Buf Toolchain:
go install github.com/bufbuild/buf/cmd/buf@latest
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install github.com/bufbuild/connect-go/cmd/protoc-gen-connect-go@latest
bazelisk build //...
bazelisk test //...
golangci-lint run
# Install new package as normal
go get github.com/your/thing
# Update Bazel with new Go package
bazelisk run //:gazelle-update-repos
# Register new files with Bazel via Gazelle
bazelisk run //:gazelle
Commits should follow conventional commits. See here for more information.
The repo is configured to use release-please to automatically create releases and changelogs based on the conventional commit messages. See here for more information.
- Connect-go service
- Buf lint and breaking detection
- Generate Tech Docs
- Change image versioning to git tags
- Link packages and containers to releases
- Swagger spec generation
- GRPC clients in multiple languages
- Setup golangci-lint
- Setup release-please
- Setup Bazel build and test
- https://bazelbuild.github.io/rules_nodejs/stamping.html
- https://github.com/bazelbuild/rules_docker#stamping
- https://github.com/google-github-actions/release-please-action
- https://github.com/golangci/golangci-lint-action
- https://github.com/orgs/community/discussions/26686
- https://github.com/orgs/community/discussions/27028
- https://github.com/orgs/community/discussions/25617
- https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow