Skip to content

fix: handle trailing slash in project path for project file naming #5

fix: handle trailing slash in project path for project file naming

fix: handle trailing slash in project path for project file naming #5

Workflow file for this run

name: Publish to PyPI
on:
push:
tags:
- 'v*' # 当推送版本标签时触发
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Extract version from tag
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Update version in setup.py
run: |
sed -i "s/version='.*'/version='$VERSION'/g" setup.py
- name: Build package
run: python -m build
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: twine upload dist/*