Skip to content

Import 'pybind11' instead running of a subprocess #8

Import 'pybind11' instead running of a subprocess

Import 'pybind11' instead running of a subprocess #8

name: Test building on GitHub Actions
on:
push:
branches:
- topics/test-gha
jobs:
make-source-dist:
runs-on: ubuntu-20.04
steps:
- name: Install dependencies
run: pip3 install build twine
- name: Get the code
uses: actions/checkout@v4
- name: Build the source distribution
run: python3 -m build --sdist
- name: Check the source distribution
run: twine check dist/*
- name: Upload the source distribution to GitHub Actions artifacts
uses: actions/upload-artifact@v4
with:
name: source-dist
path: dist
build-for-linux:
runs-on: ubuntu-20.04
needs:
- make-source-dist
strategy:
matrix:
python_version: ['3.8']
steps:
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
- name: Install Python packages
run: pip${{ matrix.python_version }} install auditwheel build Chrones pybind11 twine
- name: Dowload the source distribution from GitHub Actions artifacts
uses: actions/download-artifact@v4
with:
name: source-dist
- name: Unzip the source distribution
run: |
tar xf *.tar.gz
rm *.tar.gz
- run: python${{ matrix.python_version }} -c "import sys; print(sys.path)"
- run: python${{ matrix.python_version }} -c "import pybind11; print(pybind11)"
- name: Build the wheel
run: python${{ matrix.python_version }} -m build --wheel --outdir local-dist lincs-*
- name: Make the wheel machine-independent
run: auditwheel repair --plat manylinux_2_31_x86_64 --strip local-dist/*.whl --wheel-dir dist
- name: Check the wheel
run: twine check dist/*.whl
- name: Upload the wheel to GitHub Actions artifacts
uses: actions/upload-artifact@v4
with:
name: wheel-dist-${{ matrix.python_version }}-linux
path: dist