Merge remote-tracking branch 'refs/remotes/origin/main' #19
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: PyPi Release | |
| on: | |
| push: | |
| branches: | |
| - main # Trigger only on pushes to the main branch | |
| jobs: | |
| release: | |
| 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.9' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install setuptools wheel twine bump2version | |
| - name: Set up Git user | |
| run: | | |
| git config --local user.name "github-actions" | |
| git config --local user.email "github-actions@github.com" | |
| - name: Bump version | |
| run: bump2version patch # Adjust this if you want to bump major or minor versions | |
| - name: Push changes | |
| run: | | |
| git push | |
| git push --tags | |
| - name: Clean up old builds | |
| run: | | |
| rm -rf dist build *.egg-info | |
| - name: Build and upload package to PyPI | |
| run: | | |
| python setup.py sdist bdist_wheel | |
| twine upload dist/* | |
| env: | |
| TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | |
| TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |