release: 0.0.1.dev4 #4
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |