Publish Ruby SDKs automatically

View as Markdown

You can publish SDKs generated in Postman to RubyGems. Automated publishing is supported through GitHub Actions, which can be configured to publish your SDKs to RubyGems whenever a new release is created in your GitHub repository. By default, the predefined workflow creates a new release every time an automatic PR is merged.

You can also publish manually from your local machine. To learn more, see Publish Ruby SDKs manually.

To publish your SDKs automatically, use a RubyGems API key stored in GitHub secrets.

Prerequisites

  • A RubyGems account with a confirmed email.
  • The gem name is available, or you are an owner of the existing gem.

Create a RubyGems API key and add it to your GitHub repo

A RubyGems API key (RUBYGEMS_API_KEY) is used for authentication with the gem push command.

To create a RubyGems API key and add it to your GitHub repo, do the following:

  1. Sign in at RubyGems and select Edit Profile > API Keys > New API key.
  2. Create a key with Push rubygem scope, and scope it to the specific gem when possible.
  3. Copy the key (starts with rubygems_...). It’s shown only once.
  4. In GitHub, select your repository and click Settings > Secrets and variables > Actions > New repository secret. Name it RUBYGEMS_API_KEY and paste the key.
  • If your RubyGems account MFA level is set to UI and API, make sure API pushes are allowed or publishing is rejected.
  • Prefer an API key scoped to this SDK gem only.