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+
31+ - name : Set up Python
32+ uses : actions/setup-python@v5
33+ with :
34+ python-version : ' 3.10'
35+
36+ - name : Install uv
37+ uses : astral-sh/setup-uv@v5
38+ with :
39+ version : " latest"
40+
41+ - name : Generate API
42+ working-directory : sdks/sandbox/python
43+ run : |
44+ uv run python scripts/generate_api.py
45+
46+ - name : Build package
47+ working-directory : sdks/sandbox/python
48+ run : |
49+ uv build
50+
51+ - name : Publish to PyPI
52+ working-directory : sdks/sandbox/python
53+ env :
54+ UV_PUBLISH_TOKEN : ${{ secrets.PYPI_API_TOKEN }}
55+ run : |
56+ uv publish
57+
58+ publish-code-interpreter :
59+ if : startsWith(github.ref, 'refs/tags/python/code-interpreter/v')
60+ runs-on : ubuntu-latest
61+ steps :
62+ - name : Checkout code
63+ uses : actions/checkout@v4
64+
65+ - name : Set up Python
66+ uses : actions/setup-python@v5
67+ with :
68+ python-version : ' 3.10'
69+
70+ - name : Install uv
71+ uses : astral-sh/setup-uv@v5
72+ with :
73+ version : " latest"
74+
75+ - name : Build package
76+ working-directory : sdks/code-interpreter/python
77+ run : |
78+ uv build
79+
80+ - name : Publish to PyPI
81+ working-directory : sdks/code-interpreter/python
82+ env :
83+ UV_PUBLISH_TOKEN : ${{ secrets.PYPI_API_TOKEN }}
84+ run : |
85+ uv publish
0 commit comments