Skip to content

Commit

Permalink
Updated automatic build action
Browse files Browse the repository at this point in the history
Signed-off-by: Bhavye Mathur <[email protected]>
  • Loading branch information
BhavyeMathur committed Jan 10, 2024
1 parent 2ed50a3 commit d2db23c
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 67 deletions.
54 changes: 42 additions & 12 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# This workflow builds a shared library for goopylib using CMake

name: "Build with CMake"
name: "Build Binary & Wheels"
run-name: ${{ github.actor }} building goopylib

on:
workflow_dispatch:
Expand All @@ -9,44 +10,73 @@ on:
branches: [ "master" ]
paths:
- src/**
- goopylib/**
- CMakeLists.txt
- setup.py
- tools/setup_extensions.py
- pyproject.toml
- MANIFEST.in

pull_request:
branches: [ "master" ]
paths:
- src/**
- goopylib/**
- CMakeLists.txt
- setup.py
- tools/setup_extensions.py
- pyproject.toml
- MANIFEST.in

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release

jobs:
build:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
build-cmake:
name: Build with CMake on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest]
os: [ windows-latest, macos-latest ]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v1

- name: Configure submodules
run: git submodule update --init --recursive

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

- name: Build
# Build your program with the given configuration
- name: Build goopylib
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Test
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{env.BUILD_TYPE}}

- name: Upload Binaries
uses: test-room-7/action-update-file@v1
with:
file-path: binaries/*
commit-msg: Uploaded auto-built binaries
github-token: ${{ secrets.GITHUB_TOKEN }}

# build-wheels:
# name: Build Python wheels on ${{ matrix.os }}
# runs-on: ${{ matrix.os }}
# needs: build-cmake
#
# strategy:
# fail-fast: false
# matrix:
# os: [ windows-latest, macos-latest ]
#
# steps:
- name: Build Python wheels
uses: pypa/[email protected]
with:
path: ./wheelhouse/*.whl
2 changes: 2 additions & 0 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ on:
push:
paths:
- "**.py"
- .pylintrc

pull_request:
paths:
- "**.py"
- .pylintrc

jobs:
build:
Expand Down
53 changes: 0 additions & 53 deletions .github/workflows/python-wheels.yml

This file was deleted.

5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,13 @@ classifiers = [
include-package-data = false

[tool.cibuildwheel]
build-frontend = "build"
before-all = "git submodule update --init --recursive"
build-frontend = "build"
build = "cp38-* cp39-* cp310-* cp311-* cp312-*"

[tool.cibuildwheel.windows]
archs = ["AMD64"]

[tool.cibuildwheel.macos]
repair-wheel-command = "DYLD_LIBRARY_PATH=src/vendor/GLFW/macos:binaries/lib-macos delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}"
repair-wheel-command = "DYLD_LIBRARY_PATH=binaries/lib-macos delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}"
archs = ["arm64", "x86_64"]

0 comments on commit d2db23c

Please sign in to comment.