reset version 0.2.3 #24
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] | |
| pull_request: | |
| branches: [main] | |
| release: | |
| types: [published] | |
| permissions: | |
| id-token: write | |
| jobs: | |
| test: | |
| name: Run unit tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Force HTTPS for GitHub connections | |
| run: | | |
| git config --global url."https://github.com/".insteadOf "git@github.com:" | |
| git config --global url."https://github.com/".insteadOf "ssh://git@github.com/" | |
| - uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.14" | |
| - name: Install dependencies | |
| run: | | |
| pip install -r requirements.txt | |
| pip install ".[dev]" | |
| - name: Run tests | |
| run: pytest --tb=short | |
| build: | |
| name: Build distribution | |
| needs: test | |
| if: github.event_name == 'release' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Force HTTPS for GitHub connections | |
| run: | | |
| git config --global url."https://github.com/".insteadOf "git@github.com:" | |
| git config --global url."https://github.com/".insteadOf "ssh://git@github.com/" | |
| - uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.14" | |
| - name: Set version from tag | |
| run: | | |
| VERSION="${GITHUB_REF#refs/tags/}" | |
| VERSION="${VERSION#v}" | |
| sed -i "s/^version = \".*\"/version = \"${VERSION}\"/" pyproject.toml | |
| echo "Building version: ${VERSION}" | |
| grep '^version' pyproject.toml | |
| - name: Install build | |
| run: pip install build | |
| - name: Build package | |
| run: python -m build | |
| - name: Upload distribution artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist/ | |
| publish: | |
| name: Publish to PyPI | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/bob-dev | |
| steps: | |
| - name: Download distribution artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist/ | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 |