-
Notifications
You must be signed in to change notification settings - Fork 4
42 lines (35 loc) · 1.03 KB
/
publish.yml
File metadata and controls
42 lines (35 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Publish Python Package to PyPI on Release
on:
release:
types: [created]
jobs:
publish-to-pypi:
name: Build and Publish
runs-on: ubuntu-latest
permissions:
# 仅允许写入 GitHub 的 id-token(用于 OIDC,如需要)
id-token: write
# 仅允许读取 secrets.PYPI_TOKEN
contents: read
environment:
name: pypi
url: https://pypi.org/p/oci-documentation-mcp-server
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Upgrade build tools
run: |
python -m pip install --upgrade pip
- name: Install build backend
run: |
pip install build
- name: Build distributions
# 这里自动从 pyproject.toml 读取配置,生成 sdist + wheel
run: |
python -m build --sdist --wheel
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1