Skip to content

build_deploy

build_deploy #93

Workflow file for this run

name: build_deploy
on:
release:
types: [published]
jobs:
build_extension:
name: Build extension
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Clear pip cache
run: rm -rf ~/.cache/pip
- name: Create virtual environment and install dependencies
run: |
python -m venv venv
source venv/bin/activate
python -m pip install --upgrade pip setuptools Cython numpy>=2.0.1 --no-cache-dir
- name: Build Cython extensions
run: |
source venv/bin/activate
python setup.py build_ext --inplace
make_sdist:
needs: build_extension
name: Make source distribution
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create virtual environment and install dependencies
run: |
python -m venv venv
source venv/bin/activate
python -m pip install --upgrade pip setuptools Cython numpy==2.0.1
- name: Build source distribution
run: |
source venv/bin/activate
python setup.py sdist
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
build_wheels:
needs: make_sdist
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-20.04, windows-2019, macos-12 ]
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install Cython
python -m pip install numpy==2.0.1
- name: Build wheels
uses: pypa/cibuildwheel@v2.18.0
with:
platforms: "auto"
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
publish-to-pypi:
needs: [ build_wheels, make_sdist ]
name: Publish to PyPI
runs-on: ubuntu-latest
steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}