Skip to content

Commit

Permalink
添加自动发布到pypi的github action
Browse files Browse the repository at this point in the history
  • Loading branch information
xaoyaoo committed Oct 31, 2023
1 parent 093c451 commit 50aaff8
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/publishNew.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,19 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install build
- name: Install Twine
run: python -m pip install --upgrade twine

- name: Build package
run: python -m build

- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1 # 使用 PyPA 的 action
with:
user: __token__ # 使用 GitHub Token 进行身份验证
password: ${{ secrets.PYPI_TOKEN }} # 设置 GitHub Token 密钥
- name: Publish package with Twine
run: |
twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}

- name: Create Release
id: create_release
Expand Down

0 comments on commit 50aaff8

Please sign in to comment.