Skip to content

Python package

Python package #50

Workflow file for this run

name: Python package
permissions:
contents: write
on:
push:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"
- name: Install the project
run: uv sync --all-extras --dev --locked
- name: Run linting
run: uv run pre-commit run --all-files
- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags/')
env:
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
git diff
uv build
uv publish
- name: Make release with docset
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
body: |
This is a release for the ${{ github.ref }} tag.
draft: false
prerelease: false
generate_release_notes: true
append_body: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}