fix: windows build #73
This file contains hidden or 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 wheel on osx | |
| on: [push] | |
| env: | |
| CIBW_BUILD_VERBOSITY: 1 | |
| CIBW_BUILD: "cp38-* cp39-* cp310-* cp311-* cp312-* cp313-*" | |
| CIBW_TEST_REQUIRES: pytest | |
| CIBW_TEST_COMMAND: "pytest {project}/tests" | |
| CIBW_TEST_SOURCES: "tests" | |
| jobs: | |
| build_osx_wheels: | |
| name: Build wheels on macos-latest | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| # Used to host cibuildwheel | |
| - uses: actions/setup-python@v5 | |
| - name: Install requirements | |
| run: python -m pip install -r requirements.txt | |
| - name: Install cibuildwheel | |
| run: python -m pip install cibuildwheel | |
| - name: Build lib | |
| run: python setup.py build_lib | |
| - name: Build cdef | |
| run: python generate_cffi_definitions.py | |
| - name: Build wheels | |
| run: python -m cibuildwheel --output-dir wheelhouse | |
| env: | |
| # Override pyproject.toml settings if needed | |
| CIBW_BUILD_VERBOSITY: 1 | |
| MACOSX_DEPLOYMENT_TARGET: 14.0 | |
| # Ensure CFFI can find the static library during compilation | |
| CIBW_ENVIRONMENT: "SMPT_LIB_DIR=./lib SMPT_INCLUDE_DIR=./smpt/ScienceMode_Library/include" | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| path: wheelhouse/*.whl | |
| upload_pypi: | |
| name: Upload to PyPI (prod) | |
| needs: [build_osx_wheels] | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: artifact | |
| path: dist | |
| - uses: pypa/gh-action-pypi-publish@v1.5.0 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.PYPI_API_TOKEN }} |