Skip to content

BhavyeMathur building goopylib #23

BhavyeMathur building goopylib

BhavyeMathur building goopylib #23

# This workflow builds a shared library for goopylib using CMake & Python wheels
name: "Build Binary & Wheels"
run-name: ${{ github.actor }} building goopylib
on:
workflow_dispatch:
push:
paths:
- src/**
- goopylib/**/*.cpp
- goopylib/**/*.h
- CMakeLists.txt
- setup.py
- tools/setup_extensions.py
- pyproject.toml
- MANIFEST.in
- .github/workflows/build-goopylib.yml
pull_request:
paths:
- src/**
- goopylib/**/*.cpp
- goopylib/**/*.h
- CMakeLists.txt
- setup.py
- tools/setup_extensions.py
- pyproject.toml
- MANIFEST.in
- .github/workflows/build-goopylib.yml
env:
BUILD_TYPE: Release
jobs:
build-cmake:
name: Build with CMake on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ windows-latest, macos-latest ]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Configure submodules
run: git submodule update --init --recursive
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build goopylib
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j 8 --target goopylib
- name: Upload Binaries
uses: test-room-7/action-update-file@v1
with:
file-path: binaries/**/*.*
branch: $GITHUB_REF_NAME
allow-dot: true
commit-msg: Uploaded auto-built binaries
github-token: ${{ secrets.GITHUB_TOKEN }}
build-source-distribution:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure submodules
run: git submodule update --init --recursive
- name: Install dependencies
run: python -m pip install build
- name: Create source distribution
run: python -m build --sdist
- uses: actions/upload-artifact@v4
with:
name: goopylib-source-distribution
path: dist/
build-wheels:
name: Build ${{ matrix.os }} Python wheels
runs-on: ${{ matrix.os }}
needs: build-cmake
strategy:
fail-fast: false
matrix:
os: [ windows-latest, macos-latest ]
python: [ "cp38-", "cp39-", "cp310-", "cp311-" ]
steps:
- uses: actions/checkout@v4
- name: Configure submodules
run: git submodule update --init --recursive
- name: Build Python wheels
env:
CIBW_BUILD: ${{ matrix.python }}*
uses: pypa/[email protected]
- uses: actions/upload-artifact@v4
with:
name: goopylib-${{ matrix.python }}${{ matrix.os }}-wheels
path: wheelhouse/