1+ # Copyright 2025 Alibaba Group Holding Ltd.
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+
15+ name : Publish Python SDKs
16+
17+ on :
18+ push :
19+ tags :
20+ - ' python/sandbox/v*'
21+ - ' python/code-interpreter/v*'
22+
23+ jobs :
24+ publish-sandbox :
25+ if : startsWith(github.ref, 'refs/tags/python/sandbox/v')
26+ runs-on : ubuntu-latest
27+ steps :
28+ - name : Checkout code
29+ uses : actions/checkout@v4
30+ with :
31+ fetch-depth : 1
32+
33+ - name : Set up Python
34+ uses : actions/setup-python@v5
35+ with :
36+ python-version : ' 3.10'
37+
38+ - name : Install uv
39+ uses : astral-sh/setup-uv@v5
40+ with :
41+ version : " latest"
42+
43+ - name : Generate API
44+ working-directory : sdks/sandbox/python
45+ run : |
46+ uv run python scripts/generate_api.py
47+
48+ - name : Build package
49+ working-directory : sdks/sandbox/python
50+ run : |
51+ uv build
52+
53+ - name : Publish to PyPI
54+ working-directory : sdks/sandbox/python
55+ env :
56+ UV_PUBLISH_URL : https://test.pypi.org/legacy/
57+ UV_PUBLISH_TOKEN : ${{ secrets.PYPI_API_TOKEN }}
58+ run : |
59+ uv publish
60+
61+ publish-code-interpreter :
62+ if : startsWith(github.ref, 'refs/tags/python/code-interpreter/v')
63+ runs-on : ubuntu-latest
64+ steps :
65+ - name : Checkout code
66+ uses : actions/checkout@v4
67+ with :
68+ fetch-depth : 0
69+
70+ - name : Set up Python
71+ uses : actions/setup-python@v5
72+ with :
73+ python-version : ' 3.10'
74+
75+ - name : Install uv
76+ uses : astral-sh/setup-uv@v5
77+ with :
78+ version : " latest"
79+
80+ - name : Build package
81+ working-directory : sdks/code-interpreter/python
82+ run : |
83+ uv build
84+
85+ - name : Publish to PyPI
86+ working-directory : sdks/code-interpreter/python
87+ env :
88+ UV_PUBLISH_URL : https://test.pypi.org/legacy/
89+ UV_PUBLISH_TOKEN : ${{ secrets.PYPI_API_TOKEN }}
90+ run : |
91+ uv publish
0 commit comments