You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
resolves
https://linear.app/braintrustdata/issue/BT-5169/set-up-publish-workflow-environment-rules-for-python-sdk
Add a GitHub Actions driven stable release path that creates a
version-bump PR from the Prepare Stable Python SDK Release workflow.
Merging the release/py-sdk-v<version> PR now triggers Publish Python SDK
directly, so tagging and publishing live in one release workflow instead
of a separate tag workflow.
Gate only stable, non-dry-run PyPI publishes with the pypi-publish
environment so the job that calls trusted publishing receives the
protected environment context. After approval, the publish workflow
builds, publishes to PyPI, and creates the py-sdk-v<version> GitHub
Release tag and release.
Prereleases continue to use the manual Publish Python SDK workflow
without environment approval or a committed version bump; the requested
prerelease version is supplied as a workflow input and applied as a
build override. Update the release validator and docs for the new
process.
Copy file name to clipboardExpand all lines: AGENTS.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -287,6 +287,21 @@ Caveat:
287
287
288
288
Avoid editing `py/src/braintrust/version.py` while also running build commands.
289
289
290
+
## Publishing Notes
291
+
292
+
See `docs/publishing.md` for the full release playbook.
293
+
294
+
Stable Python SDK releases:
295
+
296
+
1. Run the `Prepare Stable Python SDK Release` workflow with a stable `X.Y.Z` version.
297
+
2. Review and merge the generated `release/py-sdk-v<version>` PR.
298
+
3. The merge triggers `Publish Python SDK`; the actual PyPI publish job is gated by the `pypi-publish` GitHub environment.
299
+
4. After approval, the workflow publishes to PyPI and creates the `py-sdk-v<version>` GitHub Release tag and release.
300
+
301
+
Prereleases stay on the manual `Publish Python SDK` path, but do not require a committed version bump: run the workflow against `main` or a commit on `main` with `release_type=prerelease` and the `version` input set to `X.Y.Zrc1`, `X.Y.Za1`, or `X.Y.Zb1`. Prereleases are not gated by the `pypi-publish` environment.
302
+
303
+
Do not create or push release tags locally.
304
+
290
305
## Dependency Pinning
291
306
292
307
All nox session dependency pins are centralized in `py/pyproject.toml`:
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+12-1Lines changed: 12 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -250,11 +250,22 @@ Main workflows:
250
250
-`checks.yaml`: merged SDK checks workflow, including lint, pinned-action validation, the Python test matrix, wheel build, and the `checks-passed` required-check aggregator
CI uses committed HTTP VCR cassettes and Claude Agent SDK subprocess cassettes, so forks do not need provider API secrets for normal replayed test runs.
257
258
259
+
## Publishing
260
+
261
+
See `docs/publishing.md` for the full Python SDK publishing playbook.
262
+
263
+
Stable releases are started from GitHub Actions by running `Prepare Stable Python SDK Release` with a stable version such as `0.22.0`. That workflow opens a `release/py-sdk-v<version>` PR that updates `py/src/braintrust/version.py`. Merging the PR triggers `Publish Python SDK`. The stable PyPI publish job requires approval through the `pypi-publish` GitHub environment, then publishes to PyPI and creates the `py-sdk-v<version>` GitHub Release tag and release.
264
+
265
+
Prereleases use the manual `Publish Python SDK` workflow without a committed version bump: run the workflow against `main` or a commit on `main` with `release_type=prerelease` and the `version` input set to a prerelease version such as `0.22.0rc1`. Prereleases are not gated by the `pypi-publish` environment.
266
+
267
+
Do not create or push release tags locally.
268
+
258
269
## Submitting Changes
259
270
260
271
1. Make your change in the narrowest relevant area.
0 commit comments