Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions cmd/release/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Release

**Release** is a command line tool that automates the versioning and releasing of multi-module Go projects.

## Limitations

- All modules have the same version.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should solve this limitation for sure, I have observed this to be a problem often. Specially with auto-dependency bump tools like renovate.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally yes. I’m still unsure about how to go about solving this

- Git tags are treated as the source of truth for the version.
Copy link
Contributor

@ajatprabha ajatprabha May 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How's this a limitation?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have seen some tools using some kind of a file to declare all modules and respective versions. The tool then uses this file to create tags etc. The downside of this approach is that it requires manually updating this file for every release.

My goal with this tool is to make it fully automated using only git data as source of truth


## Usage

### Build Manifest

`manifest` command builds the manifest file for the project. It crawls the project, finds all modules and their dependencies, and reads the respective Git tags to determine the version of each module.

The manifest file contains the following information:

- Module path
- Current version
- Dependencies and their versions (within the same repository)

_Note: Manifest file is temporary and is deleted after the release is created._

```bash
$ release manifest
```

### Create Release

`create` command creates a release branch and updates the version of the project. It reads the manifest file and updates the version of the project and all the modules within the same repository. It updates the new version in the manifest file.

```bash
$ release create --version v0.1.0
# or auto-increment the version
$ release create --major | --minor | --patch
```

### Tag

`tag` command creates Git tags for all the modules in the project. It reads the manifest file and creates Git tags for all the modules in the project.

```bash
# create tags
$ release tag
# or create and push the tags to the remote repository
$ release tag --push
```
3 changes: 3 additions & 0 deletions cmd/release/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/gojekfarm/xtools/cmd/release

go 1.24
1 change: 1 addition & 0 deletions cmd/release/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package main
Loading