Update package version #105
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
| # Workflow that bumps the package version after changes land on main. | |
| name: Versioning updates | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| Versioning: | |
| runs-on: ubuntu-latest | |
| if: | | |
| (!(github.event.head_commit.message == 'Update package version')) | |
| steps: | |
| - name: Generate GitHub App token | |
| id: app-token | |
| uses: actions/create-github-app-token@v3 | |
| with: | |
| app-id: ${{ secrets.APP_ID }} | |
| private-key: ${{ secrets.APP_PRIVATE_KEY }} | |
| - name: Checkout repo | |
| uses: actions/checkout@v6 | |
| with: | |
| token: ${{ steps.app-token.outputs.token }} | |
| fetch-depth: 0 | |
| - name: Setup Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.14 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v8.1.0 | |
| - name: Bump version and build changelog | |
| run: | | |
| pip install towncrier | |
| python .github/bump_version.py | |
| towncrier build --yes --version $(python .github/fetch_version.py) | |
| - name: Update lockfile | |
| run: uv lock | |
| - name: Update changelog | |
| uses: EndBug/add-and-commit@v10 | |
| with: | |
| add: "." | |
| message: Update package version | |
| publish-to-pypi: | |
| name: Publish to PyPI | |
| if: (github.event.head_commit.message == 'Update package version') | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.14"] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 # Fetch all history for all tags and branches | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install package | |
| run: make install | |
| - name: Build package | |
| run: python -m build | |
| - name: Publish a git tag | |
| run: ".github/publish-git-tag.sh || true" | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.PYPI }} | |
| skip-existing: true |