refactor: unsupport old arg names, use sep, fixed missing error on sep #14
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: Publish Tag-Versioned Python Package | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- 'v*.*.*' | |
jobs: | |
build_and_publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
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 setuptools wheel twine | |
- name: Check for existing dist directory | |
run: | | |
if [ -d "dist" ]; then | |
echo "Error: 'dist' directory already exists." >&2 | |
exit 1 | |
fi | |
- name: Build distribution | |
run: | | |
python setup.py sdist bdist_wheel | |
- name: Check distribution | |
run: | | |
twine check dist/* | |
- name: Upload distribution to PyPI | |
run: | | |
twine upload dist/* | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI }} | |