Skip to content

Commit 7eb9185

Browse files
author
meorphis
committed
chore(internal): configure releases
1 parent 4725cfc commit 7eb9185

File tree

2 files changed

+43
-5
lines changed

2 files changed

+43
-5
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Create releases
2+
on:
3+
schedule:
4+
- cron: '0 5 * * *' # every day at 5am UTC
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
release:
11+
name: release
12+
if: github.ref == 'refs/heads/main' && github.repository == 'openai/openai-ruby'
13+
runs-on: ubuntu-latest
14+
environment: publish
15+
permissions:
16+
contents: read
17+
id-token: write
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- uses: stainless-api/trigger-release-please@v1
23+
id: release
24+
with:
25+
repo: ${{ github.event.repository.full_name }}
26+
stainless-api-key: ${{ secrets.STAINLESS_API_KEY }}
27+
28+
- name: Set up Ruby
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+
run: |
38+
bash ./bin/publish-gem
39+
env:
40+
# `RUBYGEMS_HOST` is only required for private gem repositories, not https://rubygems.org
41+
RUBYGEMS_HOST: ${{ secrets.OPENAI_RUBYGEMS_HOST || secrets.RUBYGEMS_HOST }}
42+
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)