Skip to content

PyPI upload

PyPI upload #61

Workflow file for this run

name: CI
on:
push:
branches:
- main
tags:
- "[0-9]*"
pull_request:
branches:
- main
permissions:
actions: read
contents: read
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Ruff format
uses: astral-sh/ruff-action@v3
with:
version: "0.13.3"
args: "format --check ."
- name: Ruff check
uses: astral-sh/ruff-action@v3
with:
version: "0.13.3"
args: "check ."
build:
name: Build wheels on ${{ matrix.os }}
needs: [lint]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- ubuntu-24.04-arm
- macos-15-intel
- macos-14
# - windows-latest
# - windows-11-arm
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Build wheels
uses: pypa/cibuildwheel@v3.3.1
env:
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=${{ runner.arch == 'X64' && '15.7' || '14.8' }}
CIBW_BUILD_FRONTEND: pip
CIBW_BUILD_VERBOSITY: 0
CIBW_TEST_COMMAND: "pip install pytest && pytest {project}/tests"
CIBW_SKIP: "cp3??t-*"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
if-no-files-found: error
upload:
name: Upload to PyPI
if: startsWith(github.ref, 'refs/tags/')
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheels-*
merge-multiple: true
path: dist
- name: Display structure of downloaded files
run: ls -lh dist
- uses: pypa/gh-action-pypi-publish@release/v1
if: startsWith(github.ref, 'refs/tags/')
with:
skip-existing: true
user: ${{ secrets.PYPI_USERNAME }}
password: ${{ secrets.PYPI_PASSWORD }}