Automating Go multi-project builds with autobuild-go tool

,

I’m excited to share the release of Autobuild-Go, a tool designed to automate and streamline the build process for Golang microservices, particularly in environments with monorepos. This tool emerged from a need to handle multiple microservices more efficiently, eliminating the manual overhead that comes with building them one by one.

Why Autobuild-Go?

In our case, working with monorepos hosting various Golang microservices, we often found ourselves needing to build a bunch of them at the same time. While tools like Bazel were an option, we found them to be overly complex for our needs, so I decided to stick with the simplicity that Golang is famous for. That’s where Autobuild-Go comes in—this tool leverages Golang’s straightforward approach to offer:

  • Parallel builds across multiple architectures.
  • Automatic detection of multi-project environments in a monorepo.
  • Simple, universal usage, capable of building both single Golang apps or multiple projects with minimal configuration.
  • Automatic installation of the latest Go toolchain if it’s not already installed.
  • Generation of sha256 sum files post-build, ensuring integrity and security for your artifacts.

Key Benefits

  1. Effortless Scaling for Multi-Project Repos
    If you’re managing a large repository with many microservices, Autobuild-Go makes it incredibly easy to build all your services in one go, without needing complex configurations or scripts.
  2. Cross-Platform and Architecture Support
    It builds your services for multiple architectures, so you can deploy them wherever they’re needed, whether it’s for different OS platforms or chip architectures.
  3. Simplicity Over Complexity
    While there are other tools like Bazel, Autobuild-Go remains lightweight and keeps things simple, allowing you to focus more on development and less on build configurations.

Future Features

I’m already thinking about some potential enhancements that could make Autobuild-Go even more versatile:

  • Custom Build Hooks: Allowing users to define pre- and post-build hooks for more customization.
  • Containerized Builds: Adding Docker integration for even more isolated and controlled build environments.
  • Enhanced Multi-Repo Support: Extending support for multiple repositories, not just monorepos.
  • Improved Parallelism Control: Fine-tuning how parallel builds are handled, including resource constraints.
  • Generation of Linux distro packages: After building Linux executables, this tool can create RPMS, DEBs, AppImage, and compressed TAR files.
  • Git installation: Currently, the application detects Git installation, but if Git is not installed, it should pull the latest version from the web and add it to the toolchain.
  • GoSec integration: This application should check the security status with GoSec.
  • Linters integration: Linting is a good thing! This app should check linting, too.

Get Involved!

The tool is open source and licensed under the BSD-2 Simplified License, so anyone interested is welcome to contribute. Your input would be greatly appreciated, whether it’s refactoring, adding new features, or simply fixing bugs.

You can check out the project on GitHub and grab the binary release from GitHub Releases.

If you’re interested in contributing, feel free to submit a Merge Request (MR)! Let’s make this tool even better together. 🚀