Public | Automated Build

Last pushed: a year ago
Short Description
Compile a go project, package it to a defined format, and push a release to GitHub.
Full Description


Define a set of standards for versioning, packaging, and releasing Go projects.

This project's objective is to compile a Go project for standard architectures,
version the binaries, package it to a defined format, and push a release to GitHub.


  1. Install Docker
  2. Add go-makefile to your project by copying the GoMakefile file to your project root.
    You do not need to copy any other files from the go-makefile repository to use GoMakefile.
  3. Create a Makefile in your repository with the contents (replace
    with your package path):
    VERSION := 1.0.0

include GoMakefile

## Usage

### Build the project

`make` or `make build`

### Test and Vet the project

`make test`

### Create a GitHub Release

 1. Set the `GITHUB_TOKEN` environment variable
 1. Run `make release`

#### Release Format

The default OS architectures are darwin/amd64 and linux/amd64.
The binary is compiled with a `main.VERSION` ldflag.

 - Downloads
   - PROJECTNAME_VERSION_darwin_amd64.tar.bz2
     - compressed with bzip2 because it has the best compression ratio of
       [go supported compression algorithms](
     - contains basenamed executables in the root of the archive
   - PROJECTNAME_VERSION_linux_amd64.tar.bz2
     - "
   - SHA256SUMS
     - contains SHA 256 sums of the tar.bz2 files generated by shasum
     - one line per file and two spaces separate the checksum and filename

## Dockerfile

The [civisanalytics/go-makefile](
Docker image used by GoMakefile was created by the Dockerfile in this repository.

### Dependencies

 - The Go Programming Language
 - [gox](
 - [hub](

## Testing

Uses [bats]( Install with `brew install bats`.

Run tests with

bats test

go-makefile vs. Other Software

  • goxc
    • go-makefile focuses only on building and GitHub releasing using existing projects
      that specialize in those steps (gox and hub).
    • go-makefile does not require go to be installed (go runs inside of a docker container)
    • The configuration of go-makefile is done with Makefile variables.
  • Custom Shell Scripts
    • While these provide the most flexability, go-makefile provides a way to share a standard
      build and release process between multiple projects while defining a version and allowing
      integration with an existing Makefile workflow.




go-makefile is released under the BSD 3-Clause License.

Docker Pull Command
Source Repository

Comments (0)