made install instructions better #4
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 to PyPI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| build-publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install Poetry | |
| run: | | |
| curl -sSL https://install.python-poetry.org | python3 - | |
| echo "export PATH=$HOME/.local/bin:$PATH" >> $GITHUB_ENV | |
| - name: Configure git | |
| run: | | |
| git config user.name "GitHub Actions" | |
| git config user.email "actions@github.com" | |
| - name: Bump patch version | |
| run: | | |
| poetry version patch | |
| git add pyproject.toml | |
| git commit -m "ci: bump version [skip ci]" | |
| git tag v$(poetry version -s) | |
| - name: Push version bump and tags | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| git push https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git HEAD:main --follow-tags | |
| - name: Install dependencies | |
| run: poetry install | |
| - name: Build package | |
| run: poetry build | |
| - name: Publish to PyPI | |
| env: | |
| POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }} | |
| run: poetry publish --username __token__ --password $POETRY_PYPI_TOKEN_PYPI |