Skip to content

Update workflow for manylinux wheels #7

Update workflow for manylinux wheels

Update workflow for manylinux wheels #7

Workflow file for this run

name: Build and Upload to PyPI
on:
push:
tags:
- 'v*'
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel setuptools cython twine
- name: Install cibuildwheel
if: runner.os == 'Linux'
run: |
python -m pip install cibuildwheel
- name: Build wheel (Linux)
if: runner.os == 'Linux'
run: |
python -m cibuildwheel --output-dir wheelhouse datamule
env:
CIBW_BUILD: cp${{ matrix.python-version == '3.8' && '38' || matrix.python-version == '3.9' && '39' || matrix.python-version == '3.10' && '310' || '311' }}-manylinux_x86_64
- name: Build wheel (non-Linux)
if: runner.os != 'Linux'
working-directory: ./datamule
run: |
python setup.py bdist_wheel
- name: Store wheels (Linux)
if: runner.os == 'Linux'
uses: actions/upload-artifact@v3
with:
name: wheels
path: ./wheelhouse/*.whl
- name: Store wheels (non-Linux)
if: runner.os != 'Linux'
uses: actions/upload-artifact@v3
with:
name: wheels
path: datamule/dist/*.whl
upload_pypi:
needs: build_wheels
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel setuptools cython twine
- name: Download all wheels
uses: actions/download-artifact@v3
with:
name: wheels
path: datamule/dist
- name: Build source distribution
working-directory: ./datamule
run: python setup.py sdist
- name: Upload to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
working-directory: ./datamule
run: |
twine upload dist/*