chore: bump version to 0.1.3 #4
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 to PyPI | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| id-token: write | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.9', '3.11', '3.13'] | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install and test | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[async]" | |
| pip install pytest | |
| pytest tests/ -v | |
| publish: | |
| needs: test | |
| runs-on: ubuntu-latest | |
| environment: pypi | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: '3.12' | |
| - name: Install build tools | |
| run: pip install build | |
| - name: Verify version matches tag | |
| run: | | |
| PKG_VERSION=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])") | |
| TAG_VERSION="${GITHUB_REF_NAME#v}" | |
| if [ "$PKG_VERSION" != "$TAG_VERSION" ]; then | |
| echo "❌ pyproject.toml version ($PKG_VERSION) doesn't match tag ($TAG_VERSION)" | |
| exit 1 | |
| fi | |
| - name: Build package | |
| run: python -m build | |
| - name: Publish to PyPI (OIDC trusted publishing) | |
| uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # release/v1 | |
| with: | |
| attestations: true | |
| - name: Generate changelog | |
| run: | | |
| PREV_TAG=$(git tag --sort=-v:refname | sed -n '2p') | |
| if [ -n "$PREV_TAG" ]; then | |
| echo "## Changes since $PREV_TAG" > /tmp/changelog.md | |
| echo "" >> /tmp/changelog.md | |
| git log "$PREV_TAG"..HEAD --pretty=format:"- %s (%h)" --no-merges >> /tmp/changelog.md | |
| else | |
| echo "## Initial release" > /tmp/changelog.md | |
| echo "" >> /tmp/changelog.md | |
| git log --pretty=format:"- %s (%h)" --no-merges >> /tmp/changelog.md | |
| fi | |
| - name: Create GitHub Release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release create "${{ github.ref_name }}" \ | |
| --title "${{ github.ref_name }}" \ | |
| --notes-file /tmp/changelog.md |