Thank you for your interest in contributing to our Golang CLI Boilerplate! Our CLI serves as a robust template built on top of Cobra and Viper, coming pre-packed with utilities and AWS adapters via Golang SDK v2. This document simplifies your journey to contribute to our open-source project.
- Golang
1.20or later - Docker, or a compatible container engine for building container images
- Ensure you're installing precommit hooks by running
task pre-commit-init. This will install the pre-commit hooks in your local repository. - Optionally, you can install Taskfile to run the tasks defined in the Taskfile.yml file. However, all the Tasks within the
TaskFile.ymlare also available as Makefile targets.
- Check our open issues.
- Propose a new feature or bug fix by opening a new issue for discussion.
- For beginners, look at issues labeled as good first issue.
Contributions are always welcome whether you have a new feature proposal, a bug fix, or even if you want to improve our documentation.
For bug reports or requests, please submit your issue in the appropriate repository.
We advise that you open an issue and ask the CODEOWNERS and community prior to starting a contribution. This is your chance to ask questions and receive feedback before writing (potentially wrong) code. We value the direct contact with our community a lot, so don't hesitate to ask any questions.
Feel free to introduce yourself and discuss any issue or feature proposal.
- Fork the repo and create a new branch from
master. - Follow conventional commits to make your changes self-explanatory.
- If you're working on an existing issue, please assign it to yourself. In case you're not a member of our organization, leave a comment to let us know.
- Ensure your Pull Request is up-to-date with the
masterbranch and all checks are passing. - Fill out the PR template, link the issue it addresses, and mark it as a draft until work is complete.
- After work is complete, request a review.
We use Semantic Commits to make it easier to understand what a commit does and to build pretty changelogs. Please use the following prefixes for your commits:
feat: A new featurefix: A bug fixdocs: Documentation changeschores: Changes to the build process or auxiliary tools and libraries such as documentation generationrefactor: A code change that neither fixes a bug nor adds a featuretest: Adding missing tests or correcting existing testsci: Changes to our CI configuration files and scripts
An example for this could be:
git commit -m "docs: add a new section to the README"
Releases are done using Release Please and GoReleaser. The workflow looks like this:
-
A PR is merged to the
mainbranch:- Release please is triggered, creates or updates a new release PR
- This is done with every merge to main, the current release PR is updated every time
-
Merging the 'release please' PR to
main:- Release please is triggered, creates a new release and updates the changelog based on the commit messages
- GoReleaser is triggered, builds the binaries and attaches them to the release
- Containers are created and pushed to the container registry
NOTE: With the next relevant merge, a new release PR will be created and the process starts again
Building the binary is as simple as running go build . in the root of the repository. If you want to build the container image, you can run docker build -t golang-ci-boilerplate -f ./Dockerfile . in the root of the repository or use any of the Makefile targets or Taskfile tasks.
# Build the binary
go build .
# Build the container image
docker build -t golang-ci-boilerplate -f ./Dockerfile .
# Build the binary and container image
make build
task cli-build
# Build the docker container
make docker-build
task docker-build- Keep PRs focused and small. For multiple changes, create multiple PRs.
- Ensure your PR is up-to-date with the
mainbranch and all checks are passing. - Fill out the PR template and link the issue it addresses.
- Be constructive and assign yourself to the PR.
- Check if all checks are passing.
- If you are unsure about something, ask the author.
- Try out the changes to ensure they work as intended.
- Approve and merge the PR after ensuring it has all approvals and checks are passing.
You can build the project using go build . in the root of the repository, or if you want to create the container image, you can use docker build -t golang-cli-boilerplate -f Dockerfile . .
We automate releases using Release Please and GoReleaser. Your merged commits will automatically trigger this process.