From 43fb736c2fdf3ed281637bf360f052dd2d7cd492 Mon Sep 17 00:00:00 2001 From: Michael Nikitochkin Date: Tue, 15 Mar 2022 14:11:34 +0100 Subject: [PATCH] Release doc Add release doc with step to release a new gem. Update readme to have badges. --- README.md | 7 ++++-- RELEASE.md | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 RELEASE.md diff --git a/README.md b/README.md index 6a0489e..0cad7f9 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # toxiproxy-ruby +[![Gem Version](https://badge.fury.io/rb/toxiproxy.svg)](https://badge.fury.io/rb/toxiproxy) +[![Run tests](https://github.com/Shopify/toxiproxy-ruby/actions/workflows/ci.yml/badge.svg)](https://github.com/Shopify/toxiproxy-ruby/actions/workflows/ci.yml) + `toxiproxy-ruby` `>= 1.x` is compatible with the Toxiproxy `2.x` series. `toxiproxy-ruby` `0.x` is compatible with the Toxiproxy `1.x` series. @@ -9,8 +12,8 @@ ensure your application behaves appropriately under harsh conditions. Before you can use the Ruby library, you need to read the [Usage section of the Toxiproxy README](https://github.com/shopify/toxiproxy#usage). -``` -gem install toxiproxy +```shell +$ gem install toxiproxy ``` Make sure the Toxiproxy server is already running. diff --git a/RELEASE.md b/RELEASE.md new file mode 100644 index 0000000..0a38db8 --- /dev/null +++ b/RELEASE.md @@ -0,0 +1,74 @@ +# Release + +## Before You Begin + +Ensure your local workstation is configured to be able to +[Sign commits](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits). + +## Local Release Preparation + +### Checkout latest code + +```shell +$ git checkout master +$ git pull origin master +``` + +### Bump version + +Update version in [`lib/toxiproxy/version.rb`](./lib/toxiproxy/version.rb). +Check if there is required changes in [`README.md`](./README.md). + +### Run Tests + +Make sure all tests passed and gem could be build + +```shell +$ rake test +$ rake build +``` + +### Create Release Commit and Tag + +Commit changes and create a tag. Make sure commit and tag are signed. + +```shell +$ export RELEASE_VERSION=2.x.y +$ git commit -a -S -m "Release $RELEASE_VERSION" +$ git tag -s "v$RELEASE_VERSION" +``` + +## Release Tag + +On your local machine again, push your tag to the repository. + +```shell +$ git push origin "v$RELEASE_VERSION" +``` + +and only after push changes in `master`: + +```shell +$ git push origin master +``` + +## Verify rubygems release + +- Shipit should kick off a build and release after new version detected. +- Check [rubygems](https://rubygems.org/gems/toxiproxy) + +## Github release + +- Create a new gem + ```shell + $ bundle exec rake build + ``` +- Create github release. Choose either `hub` or `gh`. + * Github CLi [gh_release_create](https://cli.github.com/manual/gh_release_create) : + ``` + $ gh release create v pkg/toxiproxy-.gem + ``` + * Hub: + ``` + $ hub release create -a pkg/toxiproxy-.gem v + ```