Publish to PyPI via Trusted Publisher #10
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: Publish to PyPI via Trusted Publisher | |
| on: | |
| workflow_run: | |
| workflows: ["Update Version"] | |
| types: | |
| - completed | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 # 确保检出最新的代码 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.9" | |
| - name: Install dependencies | |
| run: | | |
| pip install --upgrade setuptools wheel build | |
| - name: Build the package | |
| run: | | |
| python setup.py sdist bdist_wheel | |
| - name: Pypi Publish | |
| uses: pypa/gh-action-pypi-publish@release/v1 |