Skip to content

Commit 8b6b05d

Browse files
authored
add python seprate release artifact (#46)
1 parent 10f149b commit 8b6b05d

2 files changed

Lines changed: 70 additions & 0 deletions

File tree

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# .github/workflows/release-python-sdk.yml
2+
3+
name: Release Python SDK
4+
5+
# This workflow runs when a tag starting with 'sdks/python/v' is pushed
6+
on:
7+
push:
8+
tags:
9+
- 'sdks/python/v*'
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: write
14+
15+
jobs:
16+
build-and-upload:
17+
name: Build Python SDK artifact
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: '3.10'
28+
29+
- name: Install build dependencies
30+
run: pip install build twine
31+
32+
- name: Build Python wheel and source distribution
33+
run: python3 -m build
34+
working-directory: ./sdks/python
35+
36+
- name: Create GitHub Release and Upload Artifacts
37+
uses: softprops/action-gh-release@v2
38+
with:
39+
# This will upload all files from the build output directory
40+
# (e.g., your-package-0.2.0-py3-none-any.whl and your-package-0.2.0.tar.gz)
41+
files: sdks/python/dist/*
42+
# This will create a draft release require teammate to manually publish, once
43+
# we are confident with the release process, we can set draft: false, which
44+
# will automatic create the release.
45+
draft: true

CONTRIBUTING.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,28 @@ After a new `test-server` binary is released, you need to update the checksums p
9191
6. Publish the new version to npm following internal guidance at go/wombat-dressing-room. (When prompted,
9292
create a package specific publish token for `test-server-sdk`.)
9393
94+
### Release python sdk
95+
96+
Publishing Python sdk is a relatively independent process, you can release python sdk without
97+
any change on golang `test-server` binary.
98+
99+
1. Ensure your local `main` branch is up-to-date and clean:
100+
```sh
101+
git checkout main && git pull origin main && git clean -xdf
102+
```
103+
2. Update the version in `sdks/python/pyproject.toml`, create and merge the PR.
104+
```
105+
git add .
106+
git commit -m "chore: Prepare for Python SDK release v0.1.0"
107+
git push origin release/python-v0.1.0
108+
```
109+
4. Find the current version of the python sdk in `sdks/python/pyproject.toml`. And
110+
find the current golang test-server version, make sure
111+
`sdks/python/src/test-server-sdk/checksums.json` include this version.
112+
3. Create and push a new version tag. For example, for version `sdks/python/v0.1.0-core.0.2.8`:
113+
```sh
114+
git tag -a sdks/python/v0.1.0-core.0.2.8 -m "Release Python SDK v0.1.0 for Core v0.2.8"
115+
git push origin sdks/python/v0.1.0-core.0.2.8
116+
```
117+
4. Find the draft release, verify the executable is built and uplaoaded successfully.
118+
5. Publish the relase

0 commit comments

Comments
 (0)