Skip to content

Build python-libsbml-experimental Wheels #26

Build python-libsbml-experimental Wheels

Build python-libsbml-experimental Wheels #26

name: Build python-libsbml-experimental Wheels
on:
workflow_dispatch:
jobs:
make_sdist:
name: Make SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Optional, use if you use setuptools_scm
- name: checkout needed submodules
shell: bash
run: |
./.github/workflows/checkout-submodules.sh
- name: Build SDist
run: |
# prepend the experimental flag to the environment at the start of setup.py
# by adding import os; os.environ["LIBSBML_EXPERIMENTAL"] = "1" to the beginning of setup.py
sed -i '1i import os; os.environ["LIBSBML_EXPERIMENTAL"] = "1"' setup.py
# build sdist
pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
path: dist/*.tar.gz
name: libSBML-sdist
build_wheels:
name: Wheel on ${{ matrix.os }} for ${{ matrix.python_version }}
runs-on: ${{ matrix.os }}
needs: make_sdist
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python_version: ['cp39-*', 'cp310-*', 'cp311-*', 'cp312-*', 'cp313-*']
steps:
- uses: actions/download-artifact@v4
with:
name: libSBML-sdist
- name: Extract sdist into the current directory
shell: bash
run: |
tar zxf *.tar.gz --strip-components=1
- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==2.23.2 swig==4.2.1 cmake==3.31.6
# print versions
python --version
cmake --version
swig -version
- name: Build Wheels
run: |
python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: ${{ matrix.python_version }}
CIBW_ARCHS_MACOS: x86_64 arm64
CIBW_SKIP: "*-musllinux* cp36-* cp37-* cp38-* *-win32 *-manylinux_i686"
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
path: wheelhouse/*.whl
name: libSBML-${{ matrix.os }}-${{ strategy.job-index }}
merge_wheels:
needs: [build_wheels]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
pattern: libSBML-*
path: dist
- name: Move wheels from dist subfolder to dist folder
run: |
find dist -name "*.whl" -exec mv {} dist/ \;
find dist -name "*.tar.gz" -exec mv {} dist/ \;
find dist -type d -empty -delete
- uses: actions/upload-artifact@v4
with:
name: libSBML-combined
path: dist