chore: bump version to 0.2.4 for release #11
Workflow file for this run
This file contains hidden or 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 Python Package to PyPI | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Set up Python | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: '3.x' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install setuptools wheel twine | |
| - name: Check package name availability | |
| run: | | |
| echo "Checking if package name is available on PyPI..." | |
| PACKAGE_NAME=$(python -c "from setuptools import setup; import sys; sys.argv=[sys.argv[0]]; __file__='setup.py'; exec(open('setup.py').read()); print(locals()['name'])") | |
| if pip search $PACKAGE_NAME 2>/dev/null | grep -q "^$PACKAGE_NAME "; then | |
| echo "WARNING: Package name '$PACKAGE_NAME' seems to be already taken on PyPI" | |
| echo "Please consider updating the name in setup.py before proceeding" | |
| # Uncomment next line to fail the build if you want strict enforcement | |
| # exit 1 | |
| else | |
| echo "Package name '$PACKAGE_NAME' appears to be available" | |
| fi | |
| continue-on-error: true | |
| - name: Build and publish | |
| env: | |
| TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | |
| TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
| run: | | |
| python setup.py sdist bdist_wheel | |
| twine upload dist/* |