Adding MacOS support #22
Workflow file for this run
This file contains 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: Build | |
on: [push, pull_request] | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-13, macos-14] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set OpenMP env for macos-13 | |
if: matrix.os == 'macos-13' | |
run: | | |
echo "LDFLAGS=$LDFLAGS -L/usr/local/opt/libomp/lib" >> $GITHUB_ENV | |
echo "CXXFLAGS=$CXXFLAGS -I/usr/local/opt/libomp/include" >> $GITHUB_ENV | |
- name: Set OpenMP env for macos-14 | |
if: matrix.os == 'macos-14' | |
run: | | |
echo "LDFLAGS=$LDFLAGS -L/opt/homebrew/opt/libomp/lib" >> $GITHUB_ENV | |
echo "CXXFLAGS=$CXXFLAGS -I/opt/homebrew/opt/libomp/include" >> $GITHUB_ENV | |
- name: Build wheels | |
uses: pypa/[email protected] | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} | |
path: ./wheelhouse/*.whl | |
make_sdist: | |
name: Make SDist | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Build SDist | |
run: | | |
pip install -U build | |
python -m build --sdist | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: cibw-sdist | |
path: dist/*.tar.gz | |
upload_all: | |
needs: [build_wheels, make_sdist] | |
environment: pypi | |
permissions: | |
id-token: write | |
runs-on: ubuntu-latest | |
# TODO: only run on release | |
# if: github.event_name == 'release' && github.event.action == 'published' | |
if: startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: cibw-* | |
path: dist | |
merge-multiple: true | |
- uses: pypa/gh-action-pypi-publish@release/v1 |