Split sdist from wheel generation #137
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Python Build | |
"on": | |
push: | |
branches: ["main"] | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+" | |
- "v[0-9]+.[0-9]+.[0-9]+rc[0-9]+" | |
pull_request: | |
jobs: | |
from_uv: | |
name: python uv installation | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
version: "0.6.5" | |
- name: "Set up Python" | |
uses: actions/setup-python@v5 | |
with: | |
python-version-file: "pyproject.toml" | |
- name: Install pys2let | |
run: uv sync --all-extras --dev | |
- name: run pytest | |
run: uv run pytest | |
from_sdist: | |
name: python source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
version: "0.6.5" | |
- name: "Set up Python" | |
uses: actions/setup-python@v5 | |
with: | |
python-version-file: "pyproject.toml" | |
- name: Build sdist | |
run: uv build --sdist | |
- name: create venv | |
run: uv venv | |
- name: install wheel | |
run: "uv pip install dist/pys2let-*.tar.gz" | |
- name: run pytests | |
run: uv pip install pytest && uv run pytest | |
build_wheels: | |
name: Build wheels | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
version: "0.6.5" | |
- name: "Set up Python" | |
uses: actions/setup-python@v5 | |
with: | |
python-version-file: "pyproject.toml" | |
- name: Build wheels | |
run: uv build --wheel | |
- name: create venv | |
run: uv venv | |
- name: install wheel | |
run: "uv pip install dist/*.whl" | |
- name: run pytests | |
run: uv pip install pytest && uv run pytest | |
publish_wheels: | |
name: Build wheels and publish on ${{ matrix.os }} | |
if: ${{ startsWith(github.ref, 'refs/tags') }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, ubuntu-24.04-arm, macos-13, macos-14] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
version: "0.6.5" | |
- name: Build wheels | |
uses: pypa/[email protected] | |
env: | |
CIBW_SKIP: "cp36-* cp37-* cp38-* pp* *musllinux*" | |
CIBW_BUILD_FRONTEND: "build[uv]" | |
- name: Publish distribution 📦 to Test PyPI | |
if: ${{ github.ref != 'refs/tags/v2.2.7' }} | |
run: "uv publish --publish-url https://test.pypi.org/legacy/ --token ${{ secrets.TEST_PYPI_TOKEN }} wheelhouse/*.whl" | |
- name: Publish distribution 📦 to PyPI | |
if: ${{ github.ref == 'refs/tags/v2.2.7' }} | |
run: "uv publish --token ${{ secrets.PYPI_TOKEN }} wheelhouse/*.whl" | |
publish_sdist: | |
name: Build sdist and publish on ubuntu | |
if: ${{ startsWith(github.ref, 'refs/tags') }} | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
version: "0.6.5" | |
- name: Build sdist | |
run: uv build --sdist | |
- name: Publish distribution 📦 to Test PyPI | |
if: ${{ github.ref != 'refs/tags/v2.2.7' }} | |
run: "uv publish --publish-url https://test.pypi.org/legacy/ dist/*.tar.gz" | |
- name: Publish distribution 📦 to PyPI | |
if: ${{ github.ref == 'refs/tags/v2.2.7' }} | |
run: "uv publish dist/*.tar.gz" |