Skip to content

Commit b5dd875

Browse files
committed
add pypi
1 parent 4f63de8 commit b5dd875

File tree

2 files changed

+853
-813
lines changed

2 files changed

+853
-813
lines changed

.github/workflows/pypi.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Build & Release to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*' # 仅当推送形如 v0.1.0 的标签时触发
7+
# 配置 OIDC 权限
8+
permissions:
9+
id-token: write # 允许 runner 获取 OIDC 令牌
10+
contents: read # 允许读取仓库内容
11+
12+
jobs:
13+
build-and-publish:
14+
name: Build wheel & upload to PyPI
15+
runs-on: ubuntu-latest
16+
17+
environment:
18+
name: pypi
19+
url: https://pypi.org/p/openai-router
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Install uv
26+
uses: astral-sh/setup-uv@v3
27+
with:
28+
version: latest
29+
30+
- name: Set up Python
31+
uses: actions/setup-python@v5
32+
with:
33+
python-version: '3.11' # 与 pyproject.toml 保持一致
34+
35+
- name: Build package
36+
run: uv build --wheel
37+
38+
- name: Publish to PyPI
39+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)