添加自动发布到pypi的github action

This commit is contained in:
xaoyo 2023-10-31 18:20:34 +08:00
parent 093c45179f
commit 50aaff806c

View File

@ -28,15 +28,19 @@ jobs:
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install build pip install build
- name: Install Twine
run: python -m pip install --upgrade twine
- name: Build package - name: Build package
run: python -m build run: python -m build
- name: Publish package - name: Publish package with Twine
uses: pypa/gh-action-pypi-publish@release/v1 # 使用 PyPA 的 action run: |
with: twine upload dist/*
user: __token__ # 使用 GitHub Token 进行身份验证 env:
password: ${{ secrets.PYPI_TOKEN }} # 设置 GitHub Token 密钥 TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
- name: Create Release - name: Create Release
id: create_release id: create_release