Skip to content

Update pyproject.toml #16

Update pyproject.toml

Update pyproject.toml #16

name: Build and Deploy Package and Docs
on:
pull_request:
branches:
- main
jobs:
build-and-publish:
runs-on: ubuntu-latest
env:
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
steps:
# Checkout the repository
- name: Check out repository
uses: actions/checkout@v4
# Set up Python
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
# Install dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install hatch twine mkdocs mkdocs-material "mkdocstrings[python]" bump2version
# Build and deploy mkdocs to GitHub Pages
- name: Build and deploy mkdocs
run: |
mkdocs build
mkdocs gh-deploy --force
# Configure Git author identity
- name: Configure Git author
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
# Bump version
- name: Bump version and push tag
run: |
bump2version patch # You can specify 'patch', 'minor', or 'major' based on your versioning needs
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
# Build the package distributables and publish to PyPI
- name: Build package
run: |
hatch build
- name: Publish package to PyPI
run: twine upload dist/*
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}