Skip to content

Commit 46d0a56

Browse files
authored
Merge pull request #129 from openai/meorphis/configure-releases
chore(internal): configure releases
2 parents 4725cfc + 6c89d13 commit 46d0a56

File tree

2 files changed

+44
-5
lines changed

2 files changed

+44
-5
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Create releases
2+
on:
3+
push:
4+
branches:
5+
- main
6+
workflow_dispatch:
7+
8+
jobs:
9+
release:
10+
name: release
11+
if: github.ref == 'refs/heads/main' && github.repository == 'openai/openai-ruby'
12+
runs-on: ubuntu-latest
13+
environment: publish
14+
permissions:
15+
contents: read
16+
id-token: write
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- uses: stainless-api/trigger-release-please@v1
22+
id: release
23+
with:
24+
repo: ${{ github.event.repository.full_name }}
25+
stainless-api-key: ${{ secrets.STAINLESS_API_KEY }}
26+
27+
- name: Set up Ruby
28+
if: ${{ steps.release.outputs.releases_created }}
29+
uses: ruby/setup-ruby@v1
30+
with:
31+
bundler-cache: false
32+
ruby-version: '3.1'
33+
- run: |-
34+
bundle install
35+
36+
- name: Publish to RubyGems.org
37+
if: ${{ steps.release.outputs.releases_created }}
38+
run: |
39+
bash ./bin/publish-gem
40+
env:
41+
# `RUBYGEMS_HOST` is only required for private gem repositories, not https://rubygems.org
42+
RUBYGEMS_HOST: ${{ secrets.OPENAI_RUBYGEMS_HOST || secrets.RUBYGEMS_HOST }}
43+
GEM_HOST_API_KEY: ${{ secrets.OPENAI_GEM_HOST_API_KEY || secrets.GEM_HOST_API_KEY }}

.github/workflows/publish-gem.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
# This workflow is triggered when a GitHub release is created.
2-
# It can also be run manually to re-publish to rubygems.org in case it failed for some reason.
1+
# Workflow for re-publishing to rubygems.org in case it failed for some reason.
32
# You can run this workflow by navigating to https://www.github.com/openai/openai-python/actions/workflows/publish-gem.yml
43
name: Publish Gem
54
on:
65
workflow_dispatch:
76

8-
release:
9-
types: [published]
10-
117
jobs:
128
publish:
139
name: publish

0 commit comments

Comments
 (0)