upload CD #1
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: Upload Python Package to PyPI | |
on: | |
push: | |
branches: | |
- 'v*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout repository code | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
# Install build dependencies | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install setuptools wheel twine | |
# Build the package | |
- name: Build package | |
run: | | |
python setup.py sdist bdist_wheel | |
# Upload the package to PyPI | |
- name: Upload package to PyPI | |
env: | |
TWINE_USERNAME: __token__ # PyPI API token 認證 | |
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
run: | | |
python -m twine upload dist/* |