BhavyeMathur building goopylib #16
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
# 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: | |
branches: [ "master" ] | |
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: | |
branches: [ "master" ] | |
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: master | |
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/ |