Skip to content

Update pypi.yml

Update pypi.yml #2

Workflow file for this run

name: PyPI
on:
push:
branches:
- main
paths:
- 'setup.py'
- '.github/workflows/pypi.yml'
jobs:
build-and-publish:
runs-on: windows-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x' # 选择适合你项目的Python版本
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build package
run: python -m build
- name: Publish package
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
twine upload dist/*