Skip to content

build: 通过 Trusted Publishing 发布 0.0.1.dev1 到 PyPI #1

build: 通过 Trusted Publishing 发布 0.0.1.dev1 到 PyPI

build: 通过 Trusted Publishing 发布 0.0.1.dev1 到 PyPI #1

Workflow file for this run

name: Release
# 打 v* tag 或手动触发时构建并发布到 PyPI。
# 通过 PyPI Trusted Publishing 授权,仓库里不保存任何长期凭证。
on:
push:
tags:
- "v*"
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # Trusted Publishing 换取短期令牌所必需
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Build sdist and wheel
run: |
python -m pip install --upgrade build twine
python -m build
twine check dist/*
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1.14.2