Skip to content

Latest commit

 

History

History
220 lines (167 loc) · 8.4 KB

RELEASING.md

File metadata and controls

220 lines (167 loc) · 8.4 KB

Releasing Google Cloud Ruby Client

These instructions apply to every gem within the Google Cloud Ruby Client project.

Releasing individual gems and meta-packages

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:

  1. 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
  2. Create and switch to a new branch with today's date in the name.

    $ git checkout -b releases-<yyyy-mm-dd>
  3. Review the report of changes for all gems.

    $ bundle exec rake changes
  4. 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.)

  5. In root directory of the project, review the changes for the gem since its last release.

    $ bundle exec rake changes[<gem>]
  6. 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.)

  7. 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.

  8. Edit the gem's version.rb file, if present, or the version setting in its .gemspec file, changing the value to your new semver version number.

  9. 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.

  10. If the semver version change for your gem requires an increase in the requirement for your gem in google-cloud/google-cloud.gemspec and/or stackdriver/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 the google-cloud and stackdriver gems must remain compatible so the two can co-exist in the same bundle.

  11. 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.

  12. 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> ..."
  13. Verify that your changes are complete, and that the version numbers all match.

    $ git show
  14. Repeat steps 4 through 13 if you are releasing multiple gems.

  15. If you updated google-cloud/google-cloud.gemspec for a version change to any gem, repeat steps 5 through 13 for the google-cloud gem.

  16. If you updated stackdriver/stackdriver.gemspec for a version change to any gem, repeat steps 5 through 13 for the stackdriver gem.

  17. If any dependencies have been updated in the previous steps, test that all version dependencies are correct.

    $ bundle update
    $ bundle exec rake ci[yes]
  18. 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
  19. Push the branch with your commit(s) to your personal fork of project repo.

    $ git push <user-repo> -u
  20. 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.

  21. 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.

  22. Wait until the Circle CI build has passed for the squashed pull request commit in master.

  23. 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.

    1. In the Tag version field, enter the tag name in the following format:

      <gem>/v<version>
      
    2. In the Target dropdown, select the squashed commit from your pull request.

    3. In the Release title field, enter <gem> <version>, e.g. google-cloud-bigquery 1.2.0.

    4. In the description text area, paste in the bullet-point list from the CHANGELOG.md for the gem and release.

  24. Click Publish release. This will trigger a build job on Circle CI for the tag.

  25. Wait until the Circle CI build has passed for the tag.

  26. 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.

  27. 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.

  28. Repeat steps 23 through 27 for each gem in your squashed commit.

  29. 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!

Adding a new gem to meta-packages

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.

  1. Add the gem to google-cloud/Gemfile.
  2. Add the gem to google-cloud/google-cloud.gemspec.
  3. Add the gem to gcloud/Gemfile.