Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/create-releases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Create releases
on:
push:
branches:
- main

jobs:
release:
name: release
if: github.ref == 'refs/heads/main' && github.repository == 'openai/openai-ruby'
runs-on: ubuntu-latest
environment: publish
permissions:
contents: read
id-token: write

steps:
- uses: actions/checkout@v4

- uses: stainless-api/trigger-release-please@v1
id: release
with:
repo: ${{ github.event.repository.full_name }}
stainless-api-key: ${{ secrets.STAINLESS_API_KEY }}

- name: Set up Ruby
if: ${{ steps.release.outputs.releases_created }}
uses: ruby/setup-ruby@v1
with:
bundler-cache: false
ruby-version: '3.1'
- run: |-
bundle install

- name: Publish to RubyGems.org
if: ${{ steps.release.outputs.releases_created }}
run: |
bash ./bin/publish-gem
env:
# `RUBYGEMS_HOST` is only required for private gem repositories, not https://rubygems.org
RUBYGEMS_HOST: ${{ secrets.OPENAI_RUBYGEMS_HOST || secrets.RUBYGEMS_HOST }}
GEM_HOST_API_KEY: ${{ secrets.OPENAI_GEM_HOST_API_KEY || secrets.GEM_HOST_API_KEY }}
6 changes: 1 addition & 5 deletions .github/workflows/publish-gem.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
# This workflow is triggered when a GitHub release is created.
# It can also be run manually to re-publish to rubygems.org in case it failed for some reason.
# Workflow for re-publishing to rubygems.org in case it failed for some reason.
# You can run this workflow by navigating to https://www.github.com/openai/openai-python/actions/workflows/publish-gem.yml
name: Publish Gem
on:
workflow_dispatch:

release:
types: [published]

jobs:
publish:
name: publish
Expand Down
Loading