|
| 1 | +# How to release a new git.gem |
| 2 | + |
| 3 | +Releasing a new version of the `git` gem requires these steps: |
| 4 | + * [Prepare the release](#prepare-the-release) |
| 5 | + * [Create a GitHub release](#create-a-github-release) |
| 6 | + * [Build and release the gem](#build-and-release-the-gem) |
| 7 | + |
| 8 | +These instructions use an example where the current release version is `1.5.0` |
| 9 | +and the new release version to be created is `1.6.0.pre1`. |
| 10 | + |
| 11 | +## Prepare the release |
| 12 | + |
| 13 | +From a fork of ruby-git, create a PR containing changes to (1) bump the |
| 14 | +version number, (2) update the CHANGELOG.md, and (3) tag the release. |
| 15 | + |
| 16 | + * Bump the version number in lib/git/version.rb following [Semantic Versioning](https://semver.org) |
| 17 | + guidelines |
| 18 | + * Add a link in CHANGELOG.md to the release tag which will be created later |
| 19 | + in this guide |
| 20 | + * Create a new tag using [git-extras](https://github.com/tj/git-extras/blob/master/Commands.md#git-release) |
| 21 | + `git release` command |
| 22 | + * For example: `git release v1.6.0.pre1` |
| 23 | + * These should be the only changes in the PR |
| 24 | + * An example of these changes for `v1.6.0.pre1` can be found in [PR #435](https://github.com/ruby-git/ruby-git/pull/435) |
| 25 | + * Get the PR reviewed, approved and merged to master. |
| 26 | + |
| 27 | +## Create a GitHub release |
| 28 | + |
| 29 | +On [the ruby-git releases page](https://github.com/ruby-git/ruby-git/releases), |
| 30 | +select `Draft a new release` |
| 31 | + |
| 32 | + * Select the tag corresponding to the version being released `v1.6.0.pre1` |
| 33 | + * The Target should be `master` |
| 34 | + * For the release description, use the output of [changelog-rs](https://github.com/perlun/changelog-rs) |
| 35 | + * Since the release has not been created yet, you will need to supply |
| 36 | + `changeling-rs` with the current release tag and the tag the new release |
| 37 | + is being created from |
| 38 | + * For example: `changelog-rs . v1.5.0 v1.6.0.pre1` |
| 39 | + * Copy the output, omitting the tag header `## v1.6.0.pre1` and paste into |
| 40 | + the release description |
| 41 | + * The release description can be edited later if needed |
| 42 | + * Select the appropriate value for `This is a pre-release` |
| 43 | + * Since `v1.6.0.pre1` is a pre-release, check `This is a pre-release` |
| 44 | + |
| 45 | +## Build and release the gem |
| 46 | + |
| 47 | +Clone [ruby-git/ruby-git](https://github.com/ruby-git/ruby-git) directly (not a |
| 48 | +fork) and ensure your local working copy is on the master branch |
| 49 | + |
| 50 | + * Verify that you are not on a fork with the command `git remote -v` |
| 51 | + * Verify that the version number is correct by running `rake -T` and inspecting |
| 52 | + the output for the `release[remote]` task |
| 53 | + |
| 54 | +Build the git gem and push it to rubygems.org with the command `rake release` |
| 55 | + |
| 56 | + * Ensure that your `gem sources list` includes `https://rubygems.org` (in my |
| 57 | + case, I usually have my work’s internal gem repository listed) |
0 commit comments