Skip to content

Upgrade PyPI publish version from v1.9 to v1 (i.e. using the latest in the major version 1) #209

Upgrade PyPI publish version from v1.9 to v1 (i.e. using the latest in the major version 1)

Upgrade PyPI publish version from v1.9 to v1 (i.e. using the latest in the major version 1) #209

Workflow file for this run

name: Build and publish Python distributions to PyPI
on:
push:
branches: [ 'master' ]
tags: [ '*' ]
pull_request:
branches: [ '*' ]
jobs:
checks:
name: Checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "0.5.21"
- name: Pytest
run: uv run pytest
- name: Ruff check
run: uv run ruff check
- name: Ruff format
run: uv run ruff format --check --diff
build-n-publish:
name: Build and publish Python distributions to PyPI
runs-on: ubuntu-latest
needs: checks
steps:
- uses: actions/checkout@master
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "0.5.21"
- name: Build wheel
run: uv build
- name: Publish distribution to PyPI
if: startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.pypi_token }}