This repository serves as a template for creating a monorepo for Golang projects. It is designed to streamline the development process, making it easier for teams to manage web applications and backend systems efficiently.
-
Monorepo Structure: Organize your Golang project as a monorepo, allowing you to manage multiple related services and libraries in a single repository.
-
Go Workspace: Leverage Go workspace to structure your project and manage dependencies effectively.
-
GitHub Actions: Automate your workflows with GitHub Actions. CI/CD pipelines are set up to ensure a smooth development and deployment process.
-
Single Version Policy: Adopt a single version policy for internal libraries to maintain consistency and simplify dependency management.
-
Detect modified modules: CI and CD pipelines are executed just for the modified modules, avoiding building every subproject every time. A module is considered modified even if a local dependency (lib) is modified.
To use this template for your own project, follow these steps:
-
Clone the newly created repository to your local machine.
-
Customize the project structure, adding your Golang applications and libraries.
-
Update the GitHub Actions workflows to fit the specific needs of your project.
-
Start building your Golang project with a robust and scalable monorepo structure!
The .netrc file is needed if you want to make this project private.
Go and in turn git will use the .netrc file to authenticate with GitHub to download the private packages in the lib
.
- Create a GitHub personal access token here.
- Create a
.netrc
file in this project's root folder:cp .netrc.dist .netrc
Note that the .netrc file is gitignored.
- Replace
your-github-username
with your GitHub username. - Replace
your-github-personal-access-token
with the token you created in step 1.