🐛 fix: 更新发布工作流以监听pyproject.toml文件的更改,并将版本号更新至0.1.8 #11
This file contains 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: Publish package to PyPI | |
on: | |
push: | |
paths: | |
- 'pyproject.toml' | |
permissions: | |
contents: write # 如果您的包发布到 GitHub Packages,则需要此权限 | |
packages: write # 如果您的包发布到 GitHub Packages,则需要此权限 | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install build | |
- name: Build package | |
run: python -m build | |
- name: Publish package | |
uses: pypa/gh-action-pypi-publish@release/v1 # 使用一个稳定的版本标签,而不是具体的提交哈希 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} |