Releasing a new version of the git
gem requires these steps:
These instructions use an example where the current release version is 1.5.0
and the new release version to be created is 1.6.0.pre1
.
From a fork of ruby-git, create a PR containing changes to (1) bump the version number, (2) update the CHANGELOG.md, and (3) tag the release.
- Bump the version number in lib/git/version.rb following Semantic Versioning guidelines
- Add a link in CHANGELOG.md to the release tag which will be created later in this guide
- Create a new tag using git-extras
git release
command- For example:
git release v1.6.0.pre1
- For example:
- These should be the only changes in the PR
- An example of these changes for
v1.6.0.pre1
can be found in PR #435 - Get the PR reviewed, approved and merged to master.
On the ruby-git releases page,
select Draft a new release
- Select the tag corresponding to the version being released
v1.6.0.pre1
- The Target should be
master
- For the release description, use the output of changelog-rs
- A Docker image is provided in Dockerfile.changelog-rs
so you don't have to install changelog-rs or the Rust tool chain. To build the
Docker image, run this command from this project's root directory:
docker build --file Dockerfile.changelog-rs --tag changelog-rs .
- To run the changelog-rs command using this image, run the following command
from this project's root directory (replace the tag names appropriate for the
current release):
docker run --rm --volume "$PWD:/worktree" changelog-rs v1.5.0 v1.6.0.pre1
- Copy the output, omitting the tag header
## v1.6.0.pre1
and paste into the release description - The release description can be edited later if needed
- A Docker image is provided in Dockerfile.changelog-rs
so you don't have to install changelog-rs or the Rust tool chain. To build the
Docker image, run this command from this project's root directory:
- Select the appropriate value for
This is a pre-release
- Since
v1.6.0.pre1
is a pre-release, checkThis is a pre-release
- Since
Clone ruby-git/ruby-git directly (not a fork) and ensure your local working copy is on the master branch
- Verify that you are not on a fork with the command
git remote -v
- Verify that the version number is correct by running
rake -T
and inspecting the output for therelease[remote]
task
Build the git gem and push it to rubygems.org with the command rake release
- Ensure that your
gem sources list
includeshttps://rubygems.org
(in my case, I usually have my work’s internal gem repository listed)