These instructions apply to every gem within the Google Cloud Ruby Client project.
The Google Cloud Ruby Client project uses semantic
versioning. Replace the <version>
placeholder in the
examples below with the appropriate number, e.g. 0.1.0
. Replace the <gem>
placeholder with the appropriate full name of the gem, e.g.
google-cloud-datastore
.
After all pull requests for a release have been merged and all Kokoro and Circle CI builds are green, you may create a release as follows:
-
In root directory of the project, switch to the master branch, ensure that you have no changes, and pull from the project repo.
$ git checkout master $ git status $ git pull <remote> master
-
Create and switch to a new branch with today's date in the name.
$ git checkout -b releases-<yyyy-mm-dd>
-
Review the report of changes for all gems.
$ bundle exec rake changes
-
Choose a gem to release based on the changes report from the previous step. If there are changes to google-cloud-env, google-cloud-core, and/or stackdriver-core, be sure to release them first, in the order listed. Release google-cloud and stackdriver last, in case of dependency changes. (See steps 15 and 16, below.)
-
In root directory of the project, review the changes for the gem since its last release.
$ bundle exec rake changes[<gem>]
-
Review the commits in the output from the previous step, making note of significant changes. (For examples of what a significant change is, browse the changes in the gem's
CHANGELOG.md
.) -
Edit the gem's
CHANGELOG.md
. Using your notes from the previous step, write a bullet-point list of the major and minor changes. You can also call out breaking changes, fixes, contributor credits, and anything else helpful or relevant. See google-cloud-bigquery v1.2.0 for an example. -
Edit the gem's
version.rb
file, if present, or theversion
setting in its.gemspec
file, changing the value to your new semver version number. -
If your gem is new, ensure that it has been added to the top-level
Gemfile
. Follow the steps in Adding a new gem to meta-packages, below. -
If the semver version change for your gem requires an increase in the requirement for your gem in
google-cloud/google-cloud.gemspec
and/orstackdriver/stackdriver.gemspec
, replace the old version requirement with your new requirement. Note that because of the use of the pessimistic operator (~>
), only certain version changes will require updating the requirement. Note also that the dependency requirements in thegoogle-cloud
andstackdriver
gems must remain compatible so the two can co-exist in the same bundle. -
If your gem is new, ensure that a nav link and a main entry including code example have been added to the top-level README.
-
Commit your changes. Copy and paste the significant points from your
CHANGELOG.md
edit as the description in your commit message.$ git commit -am "Release <gem> <version> ..."
-
Verify that your changes are complete, and that the version numbers all match.
$ git show
-
Repeat steps 4 through 13 if you are releasing multiple gems.
-
If you updated
google-cloud/google-cloud.gemspec
for a version change to any gem, repeat steps 5 through 13 for thegoogle-cloud
gem. -
If you updated
stackdriver/stackdriver.gemspec
for a version change to any gem, repeat steps 5 through 13 for thestackdriver
gem. -
If any dependencies have been updated in the previous steps, test that all version dependencies are correct.
$ bundle update $ bundle exec rake ci[yes]
-
Rebase your commit(s) on the latest remote master.
$ git checkout master $ git pull <remote> master $ git checkout releases-<yyyy-mm-dd> $ git rebase master
-
Push the branch with your commit(s) to your personal fork of project repo.
$ git push <user-repo> -u
-
Create a pull request from your fork using the branch containing your commit(s). Assign the pull request to yourself for merging. Request the appropriate reviewers.
-
After your pull request has passed all checks and been approved by reviewers, Squash and merge it. This will trigger a build job on Circle CI.
-
Wait until the Circle CI build has passed for the squashed pull request commit in master.
-
On the google-cloud-ruby releases page, click Draft a new release. Complete the form as follows for each gem in your pull request. You should refer to the GitHub view of your squashed commit for content.
-
In the
Tag version
field, enter the tag name in the following format:<gem>/v<version>
-
In the
Target
dropdown, select the squashed commit from your pull request. -
In the
Release title
field, enter<gem> <version>
, e.g.google-cloud-bigquery 1.2.0
. -
In the description text area, paste in the bullet-point list from the
CHANGELOG.md
for the gem and release.
-
-
Click
Publish release
. This will trigger a build job on Circle CI for the tag. -
Wait until the Circle CI build has passed for the tag.
-
Confirm that the new version is displayed on the google-cloud-ruby gh-pages doc site. Or, to save time when releasing many gems at once, check out the gh-pages branch and pull repeatedly to confirm that it has received the new docs.
If the gh-pages branch has not been updated, inspect the Kokoro build logs to confirm that the rake
post
task succeeded. -
Confirm that the gem for the new version is available on RubyGems.org.
If RubyGems.org has not been updated, inspect the Circle CI build logs to confirm that the rake
release
task succeeded. -
Repeat steps 23 through 27 for each gem in your squashed commit.
-
After the Circle CI master branch build has successfully completed, confirm that the Kokoro master branch builds are also green by looking for green checkmarks next to the timestamp for each commit.
High fives all around!
There are extra steps required to add a new gem to the google-cloud
and/or
stackdriver
meta-package gems. These instructions are for the google-cloud
gem.
- Add the gem to
google-cloud/Gemfile
. - Add the gem to
google-cloud/google-cloud.gemspec
. - Add the gem to
gcloud/Gemfile
.