From 48ea01aae00f7a51024017a02ecdb1553a1679e8 Mon Sep 17 00:00:00 2001 From: Mohamed Ziata Date: Fri, 17 Dec 2021 17:18:33 +0100 Subject: [PATCH] :memo: RELEASE_PROCESS --- CHANGELOG.md | 4 ++++ Gemfile | 3 +++ Gemfile.lock | 24 +++++++++---------- RELEASE_PROCESS.md | 51 ++++++++++++++++++++++++++++++++++++++++ lib/zoho_sign/version.rb | 2 +- 5 files changed, 71 insertions(+), 13 deletions(-) create mode 100644 RELEASE_PROCESS.md diff --git a/CHANGELOG.md b/CHANGELOG.md index be5ab66..3792bab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## [Unreleased] +# [0.1.1] - 2021-12-17 + +Created `RELEASE_PROCESS.md`. + ## [0.1.0] - 2021-09-17 - Initial release: diff --git a/Gemfile b/Gemfile index eb202be..ecd6f7f 100644 --- a/Gemfile +++ b/Gemfile @@ -19,3 +19,6 @@ gem "pry" gem "faker" gem "rspec", "~> 3.0" gem "webmock" + +# Publish Gem +gem "gem-release", "~> 2.2" diff --git a/Gemfile.lock b/Gemfile.lock index 185a657..0dc3632 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -12,12 +12,11 @@ PATH GEM remote: https://rubygems.org/ specs: - activesupport (6.1.4.1) + activesupport (7.0.0) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) - zeitwerk (~> 2.3) addressable (2.8.0) public_suffix (>= 2.0.2, < 5.0) ast (2.4.2) @@ -53,16 +52,17 @@ GEM faraday-net_http_persistent (1.2.0) faraday-patron (1.0.0) faraday-rack (1.0.0) - faraday_middleware (1.1.0) + faraday_middleware (1.2.0) faraday (~> 1.0) + gem-release (2.2.2) hashdiff (1.0.1) - i18n (1.8.10) + i18n (1.8.11) concurrent-ruby (~> 1.0) method_source (1.0.0) - minitest (5.14.4) + minitest (5.15.0) multipart-post (2.1.1) parallel (1.21.0) - parser (3.0.2.0) + parser (3.0.3.2) ast (~> 2.4.1) pry (0.14.1) coderay (~> 1.1) @@ -70,7 +70,7 @@ GEM public_suffix (4.0.6) rainbow (3.0.0) rake (13.0.6) - regexp_parser (2.1.1) + regexp_parser (2.2.0) rexml (3.2.5) rspec (3.10.0) rspec-core (~> 3.10.0) @@ -84,17 +84,17 @@ GEM rspec-mocks (3.10.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.10.0) - rspec-support (3.10.2) - rubocop (1.21.0) + rspec-support (3.10.3) + rubocop (1.23.0) parallel (~> 1.10) parser (>= 3.0.0.0) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml - rubocop-ast (>= 1.9.1, < 2.0) + rubocop-ast (>= 1.12.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.12.0) + rubocop-ast (1.15.0) parser (>= 3.0.1.1) ruby-progressbar (1.11.0) ruby2_keywords (0.0.5) @@ -105,7 +105,6 @@ GEM addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) - zeitwerk (2.4.2) PLATFORMS x86_64-linux @@ -113,6 +112,7 @@ PLATFORMS DEPENDENCIES dotenv faker + gem-release (~> 2.2) pry rake (~> 13.0) rspec (~> 3.0) diff --git a/RELEASE_PROCESS.md b/RELEASE_PROCESS.md new file mode 100644 index 0000000..6fb7d4c --- /dev/null +++ b/RELEASE_PROCESS.md @@ -0,0 +1,51 @@ +# How to create a new release + +## Step 1: Update `CHANGELOG.md` + +The step 1 is to make sure the `CHANGELOG.md` is up-to-date. If is not up-to-date +please update the missing changes. + +## Step 2: Prepare the release + +Note: This steps needs to be performed in the `main` branch. Remember to have a up-to-date repo. + +First open the `lib/zoho_sign/version.rb` file and update the `VERSION` constant. + +We are following "[Semantic Versioning v2](https://semver.org/spec/v2.0.0.html)" conventions. + +## Step 3: Setup your environment + +First of all make sure you have the file `~/.gem/credentials` with this content: + +```yml +--- +:rubygems_api_key: $RUBYGEM_API_KEY +:github: $GITHUB_TOKEN_API_KEY +``` + +You can get your `$RUBYGEM_API_KEY` from your RubyGems.org account. +You can get your `$GITHUB_TOKEN_API_KEY` from your GitHub.com account. Instructions [here](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token). + +## Step 4: Publish new gem version in GitHub Package Registry + +Now last step run this terminal commands: + +```bash +gem build *.gemspec +gem push --KEY github --host https://$GITHUB_USER:$GITHUB_TOKEN_API_KEY@rubygems.pkg.github.com/wecasa *.gem +``` + +- `$GITHUB_USER` -> example `wakematta` +- `$GITHUB_TOKEN_API_KEY` -> Instructions [here](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token). + +## Step 5: Publish new gem version in RubyGems.org + +Now you can run this terminal command: + +```bash +gem bump --release --push --tag --version '$NEW_RELEASE_VERSION' --message ':arrow_up: Prepare release v%{version} %{skip_ci}' +``` + +Remember that `$NEW_RELEASE_VERSION` needs to be the same as the one in `lib/zoho_sign/version.rb`. + +You can add `--pretend` to the command, to make sure there is no erros. Before doing it for real. diff --git a/lib/zoho_sign/version.rb b/lib/zoho_sign/version.rb index 1dd905a..d522433 100644 --- a/lib/zoho_sign/version.rb +++ b/lib/zoho_sign/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module ZohoSign - VERSION = "0.1.0" + VERSION = "0.1.1" end