Skip to content

Merge pull request #5339 from yt-project/pre-commit-ci-update-config #90

Merge pull request #5339 from yt-project/pre-commit-ci-update-config

Merge pull request #5339 from yt-project/pre-commit-ci-update-config #90

Workflow file for this run

name: Build CI Wheels
on:
push:
branches:
- main
- stable
tags:
- 'yt-*'
pull_request:
paths:
- '.github/workflows/wheels.yaml'
- MANIFEST.in
- pyproject.toml
- setup.py
- setupext.py
workflow_dispatch:
jobs:
build_wheels:
name: Build ${{ matrix.select }}-${{ matrix.archs }} wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
archs: x86_64
select: '*manylinux*'
id: manylinux_x86_64
- os: ubuntu-latest
archs: x86_64
select: '*musllinux*'
id: musllinux_x86_64
- os: macos-latest
archs: x86_64
select: '*'
id: macos_x86_64
- os: macos-latest
archs: arm64
select: '*'
id: macos_arm64
- os: windows-latest
archs: AMD64
select: '*'
id: windows_AMD64
steps:
- name: Checkout repo
uses: actions/checkout@v6
- name: Build wheels for CPython
uses: pypa/cibuildwheel@v3.3.0
with:
extras: uv
output-dir: dist
env:
CIBW_ARCHS: ${{ matrix.archs }}
CIBW_BUILD: ${{ matrix.select }}
- uses: actions/upload-artifact@v5
with:
name: wheels-${{ matrix.os }}-${{ matrix.id }}
path: ./dist/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v6
- name: Set up Python
uses: astral-sh/setup-uv@v7
with:
python-version: '3.10'
enable-cache: false
- name: Build sdist
run: uv build --sdist
- name: Upload sdist
uses: actions/upload-artifact@v5
with:
name: sdist
path: dist/*.tar.gz
- name: copy configuration files
run: |
mkdir cfg
cp pyproject.toml cfg
cp conftest.py cfg
- name: Upload pytest configuration files
uses: actions/upload-artifact@v5
with:
name: pytest-conf
path: cfg
test_sdist:
name: Test source distribution
runs-on: ubuntu-latest
needs: [build_sdist]
steps:
- name: Download sdist
uses: actions/download-artifact@v6
with:
name: sdist
path: dist
- name: Set up Python
uses: astral-sh/setup-uv@v7
with:
python-version: '3.10'
enable-cache: false
activate-environment: true # allows using uv pip directly
- name: Download pytest configuration files
uses: actions/download-artifact@v6
with:
name: pytest-conf
path: cfg
- name: Display structure of downloaded files
run: ls -R
- name: Install sdist
run: uv pip install "$(echo dist/yt-*.tar.gz)[test]"
- run: uv pip list
- name: Test sdist
run: |
uv run --no-project --directory cfg \
pytest --color=yes --pyargs yt
check_manifest:
name: Check MANIFEST.in
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v6
with:
submodules: true
- name: Set up Python
uses: astral-sh/setup-uv@v7
with:
python-version: '3.13'
enable-cache: false
- name: run check-manifest
run: uvx check-manifest -vvv
deploy:
name: Publish to PyPI
needs: [build_wheels, test_sdist, check_manifest]
runs-on: ubuntu-latest
# upload to PyPI on every tag starting with 'yt-'
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/yt-')
steps:
- name: Download sdist
uses: actions/download-artifact@v6
with:
name: sdist
path: dist
- name: Download wheels
uses: actions/download-artifact@v6
with:
path: dist
pattern: wheels-*
merge-multiple: true
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1.13.0
with:
user: __token__
password: ${{ secrets.pypi_token }}