Skip to content

chore: bump version to 0.1.1 #1

chore: bump version to 0.1.1

chore: bump version to 0.1.1 #1

Workflow file for this run

name: Publish to PyPI
on:
push:
branches: [main]
paths:
- pyproject.toml
jobs:
check-version:
name: Check for version change
runs-on: ubuntu-latest
outputs:
version_changed: ${{ steps.check.outputs.changed }}
version: ${{ steps.check.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Check if version changed
id: check
run: |
current=$(grep '^version' pyproject.toml | head -1 | sed 's/.*"\(.*\)"/\1/')
previous=$(git show HEAD~1:pyproject.toml 2>/dev/null | grep '^version' | head -1 | sed 's/.*"\(.*\)"/\1/' || echo "")
echo "version=$current" >> "$GITHUB_OUTPUT"
if [ "$current" != "$previous" ]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
else
echo "changed=false" >> "$GITHUB_OUTPUT"
fi
build:
name: Build distribution
needs: check-version
if: needs.check-version.outputs.version_changed == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Build package
run: uv build
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
publish:
name: Publish ${{ needs.check-version.outputs.version }} to PyPI
needs: [check-version, build]
runs-on: ubuntu-latest
environment: production
permissions:
id-token: write
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1