🍒 Build, Release, and More!
I started building Cherry exactly 2 years ago. It was an experimental tool that worked very well.
Since then, it is used in real-world development teams for production purposes successfully.
After 2 years, I took the learnings and experience with Cherry and built a new tool with a new vision.
You can now start using Gelato.
Gelato currently provides the same features as Cherry, but it eliminates the external dependency on git and github_changelog_generator.
Cherry is an experimental tool and it is WORK-IN-PROGRESS.
Cherry is an opinionated tool for buidling and releasing applications.
Currently, Cherry only supports Go for building and GitHub repositories for releasing.
For Go applications, Cherry supports cross-compiling and injecting metadata into the binaries.
You need to have the following tools installed and ready.
For releasing GitHub repository you need a personal access token with admin access to your repo.
curl -s https://git.io/JeCX6 | sh
Or
curl -s https://raw.githubusercontent.com/moorara/cherry/master/scripts/install.sh | sh
The docker image for Cherry includes all the required tools and is accessible at moorara/cherry.
You can take a look at examples to see how you can use and configure Cherry.
Cherry uses Semantic Versioning 2.0.0 as described here.
For injecting versioning and other metadata into your binaries,
you need to have a version
package with the following exported variables in it:
var (
Version string
Commit string
Branch string
GoVersion string
BuildTool string
BuildTime string
)
The initial release is always 0.1.0
.
You can run cherry
or cherry -help
to see the list of available commands.
For each command, you can also use -help
flag too see the help for that command.
cherry init
creates and adds the following files required by Cherry.
This can be used for initializing a Go repository to work with Cherry.
cherry.yaml
)version/version.go
)cherry semver
resolves and prints the current semantic version.
This can be used to get the current semantic version for building other artifacts such as Docker image.
cherry build
compiles your binary and injects the build information into the version
package.cherry build -cross-compile
will build the binaries for all supported platforms.
cherry release
can be used for releasing a GitHub repository.
You can use -patch
, -minor
, or -major
flags to release at different levels.
You can also use -comment
flag to include a description for your release.
CHERRY_GITHUB_TOKEN
environment variable should be set to a personal access token with admin permission to your repo.
cherry update
will update Cherry to the latest version.
It downloads the latest release for your system from GitHub and replaces the local binary.
Command | Description |
---|---|
make build |
Build the binary locally |
make build-all |
Build the binary locally for all supported platforms |
make test |
Run the unit tests |
make test-short |
Run the unit tests using -short flag |
make coverage |
Run the unit tests with coverage report |
make docker |
Build Docker image |
make push |
Push built image to registry |
make save-docker |
Save built image to disk |
make load-docker |
Load saved image from disk |