This document describes the release process for git-tree-go.
- Ensure you have write access to the repository
- Make sure all tests pass:
make test - Ensure the
masterbranch is up to date - Review and update
CHANGELOG.mdif needed
The project includes a Go-based release tool that automates the release process.
make release-toolThis creates the bin/release executable. This tool is for developers only and is not installed with the other commands.
Basic usage:
./bin/releaseThe tool will:
- Show the current version
- Prompt for the new version number (with an auto-incremented default)
- Validate the version format
- Check you're on the main/master branch
- Commit any uncommitted changes (instead of aborting)
- Verify the tag doesn't already exist
- Run tests (unless you skip them with
-s) - Update
internal/version.gowith the new version - Ask for confirmation (defaults to "Yes")
- Create and push the version tag
- Trigger the GitHub Actions release workflow
./bin/release [OPTIONS] [VERSION]Options:
-d, --debug: Run GoReleaser in debug mode in the CI workflow-h, --help: Display help message-s, --skip-tests: Skip running integration tests
Examples:
# Interactive release (prompts for version)
./bin/release
# Specify version directly
./bin/release 1.2.3
# Skip tests during release
./bin/release -s 1.2.4
# Enable debug mode for GoReleaser
./bin/release -d 1.2.5If you prefer to create releases manually, you can still use git tags directly:
# For a new version (e.g., v1.2.3)
git tag -a v1.2.3 -m "Release v1.2.3"
git push origin v1.2.3Once you push a tag starting with v (either via the release tool or manually), GitHub Actions will automatically:
- Run the release workflow (
.github/workflows/release.yml) - Build binaries for all platforms using GoReleaser
- Create a GitHub release with:
- All command binaries (
git-commitAll,git-evars,git-exec,git-replicate,git-treeconfig,git-update) - Archives for each platform (Linux, macOS, Windows)
- Checksums file
- Auto-generated changelog
- All command binaries (
The release process builds for:
- Operating Systems: Linux, macOS (Darwin), Windows
- Architectures: amd64 (x86_64), arm64
This produces 12 archives (6 platform/arch combinations × 2 formats):
.tar.gzfor Linux and macOS.zipfor Windows
After the workflow completes:
- Go to the Releases page
- Verify the new release is published
- Check that all binaries are present
- Test download and execution on at least one platform
We follow Semantic Versioning:
- MAJOR version: Incompatible API changes
- MINOR version: New functionality (backwards compatible)
- PATCH version: Bug fixes (backwards compatible)
Examples:
v1.0.0- Initial stable releasev1.1.0- New feature addedv1.1.1- Bug fixv2.0.0- Breaking changes
Before creating a release, update the CHANGELOG.md file with:
- New features
- Bug fixes
- Breaking changes
- Deprecations
If a release has issues:
-
Delete the tag locally and remotely:
git tag -d v1.2.3 git push origin :refs/tags/v1.2.3
-
Delete the GitHub release through the web interface
-
Fix the issues and create a new release with a patch version bump
If GitHub Actions is unavailable, you can create a release manually:
# Install GoReleaser
go install github.com/goreleaser/goreleaser@latest
# Create a tag
git tag -a v1.2.3 -m "Release v1.2.3"
# Build and release
GITHUB_TOKEN="your_token" goreleaser release --clean- Check the Actions tab for error details
- Verify GoReleaser configuration:
goreleaser check - Test locally:
goreleaser release --snapshot --clean
- Check
.goreleaser.ymlbuild configuration - Verify all commands compile:
make build - Check build logs in GitHub Actions
The version is set via ldflags during build. Ensure:
- The tag follows the
v*pattern - GoReleaser is substituting
{{.Version}}correctly