1414 - ' stl-preview-head/**'
1515 - ' stl-preview-base/**'
1616 workflow_dispatch :
17+ inputs :
18+ release_pr :
19+ description : Run required CI for a Release Please branch
20+ required : false
21+ default : false
22+ type : boolean
1723 # Exercise the complete supported matrix and the next CPython prerelease
1824 # even when the repository has not changed.
1925 schedule :
2026 - cron : ' 47 9 * * *'
2127
28+ permissions :
29+ contents : read
30+
2231jobs :
2332 lint :
2433 timeout-minutes : 10
2534 name : lint
2635 runs-on : ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
27- if : (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
36+ if : (github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.release_pr && github.ref == 'refs/heads/release-please--branches--main') || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
2837 steps :
2938 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
3039
@@ -41,15 +50,16 @@ jobs:
4150 run : ./scripts/lint
4251
4352 build :
44- if : (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
53+ if : (github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.release_pr && github.ref == 'refs/heads/release-please--branches--main') || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
4554 timeout-minutes : 10
4655 name : build
4756 permissions :
4857 contents : read
49- id-token : write
5058 runs-on : ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
5159 steps :
5260 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
61+ with :
62+ persist-credentials : false
5363
5464 - name : Set up Rye
5565 uses : eifinger/setup-rye@c694239a43768373e87d0103d7f547027a23f3c8
@@ -88,19 +98,44 @@ jobs:
8898 - name : Validate HTTPX2 wheel on Python 3.14
8999 run : python scripts/utils/validate-httpx2-wheel.py
90100
91- - name : Get GitHub OIDC Token
101+ - name : Stage tarball for Stainless upload
92102 if : |-
93103 github.repository == 'stainless-sdks/openai-python' &&
94104 !startsWith(github.ref, 'refs/heads/stl/')
105+ uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
106+ with :
107+ name : stainless-package-tarball
108+ path : dist/
109+ if-no-files-found : error
110+ retention-days : 1
111+
112+ stainless-upload :
113+ name : upload tarball to Stainless
114+ needs : build
115+ if : github.repository == 'stainless-sdks/openai-python' && !startsWith(github.ref, 'refs/heads/stl/')
116+ runs-on : ubuntu-latest
117+ permissions :
118+ contents : read
119+ id-token : write
120+
121+ steps :
122+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
123+ with :
124+ persist-credentials : false
125+
126+ - name : Download tarball
127+ uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
128+ with :
129+ name : stainless-package-tarball
130+ path : dist/
131+
132+ - name : Get GitHub OIDC Token
95133 id : github-oidc
96134 uses : actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
97135 with :
98136 script : core.setOutput('github_token', await core.getIDToken());
99137
100138 - name : Upload tarball
101- if : |-
102- github.repository == 'stainless-sdks/openai-python' &&
103- !startsWith(github.ref, 'refs/heads/stl/')
104139 env :
105140 URL : https://pkg.stainless.com/s
106141 AUTH : ${{ steps.github-oidc.outputs.github_token }}
@@ -111,7 +146,7 @@ jobs:
111146 timeout-minutes : 15
112147 name : test (Python ${{ matrix.python-version }})
113148 runs-on : ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
114- if : github.event_name == 'push' || github.event.pull_request.head.repo.fork
149+ if : github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.release_pr && github.ref == 'refs/heads/release-please--branches--main') || github.event.pull_request.head.repo.fork
115150 strategy :
116151 fail-fast : false
117152 matrix :
@@ -147,7 +182,7 @@ jobs:
147182 timeout-minutes : 20
148183 name : test (HTTPX2)
149184 runs-on : ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
150- if : github.event_name == 'push' || github.event.pull_request.head.repo.fork
185+ if : github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.release_pr && github.ref == 'refs/heads/release-please--branches--main') || github.event.pull_request.head.repo.fork
151186 steps :
152187 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
153188
@@ -224,7 +259,7 @@ jobs:
224259 timeout-minutes : 20
225260 name : compatibility (Python ${{ matrix.python-version }})
226261 runs-on : ubuntu-latest
227- if : github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
262+ if : github.event_name == 'schedule' || ( github.event_name == 'workflow_dispatch' && !inputs.release_pr)
228263 continue-on-error : ${{ matrix.experimental }}
229264 strategy :
230265 fail-fast : false
0 commit comments