try building wheels with CI for pdffit2 #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: Wheel builder | |
on: | |
# workflow_call: | |
# inputs: | |
# project: | |
# description: 'Name of the project to test' | |
# default: 'PROJECT_NAME' | |
# required: false | |
# type: string | |
# c_extension: | |
# description: 'Whether the project has a C extension' | |
# default: false | |
# required: false | |
# type: boolean | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build_wheels: | |
defaults: | |
run: | |
shell: bash -l {0} | |
name: Build wheel ${{ matrix.python[0] }}-${{ matrix.buildplat[0] }} | |
runs-on: ${{ matrix.buildplat[0] }} | |
strategy: | |
fail-fast: false | |
matrix: | |
buildplat: | |
- [ubuntu-latest, manylinux_x86_64] | |
- [macos-13, macosx_x86_64] | |
- [macos-14, macosx_arm64] | |
- [windows-latest, win_amd64] | |
python: | |
- ["3.10", "cp310"] | |
- ["3.11", "cp311"] | |
- ["3.12", "cp312"] | |
steps: | |
- name: Check out #${{ inputs.project }} | |
uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python[0] }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python[0] }} | |
- name: Build wheels for Linux | |
if: runner.os == 'Linux' | |
uses: pypa/cibuildwheel@v2.21.1 | |
env: | |
CIBW_BUILD: ${{ matrix.python[1] }}-${{ matrix.buildplat[1] }} | |
CIBW_BEFORE_BUILD: yum install -y gsl-devel && pip install -e . | |
with: | |
output-dir: wheelhouse | |
- name: Build wheels for macOS | |
if: runner.os == 'macOS' | |
uses: pypa/cibuildwheel@v2.21.1 | |
env: | |
CIBW_BUILD: ${{ matrix.python[1] }}-${{ matrix.buildplat[1] }} | |
MACOSX_DEPLOYMENT_TARGET: 13.0 | |
CIBW_BEFORE_BUILD: brew install gsl && pip install -e . | |
with: | |
output-dir: wheelhouse | |
- name: Install GSL and Set Environment for GSL on Windows | |
if: runner.os == 'Windows' | |
shell: pwsh | |
run: | | |
git clone https://github.com/microsoft/vcpkg.git | |
cd vcpkg | |
.\bootstrap-vcpkg.bat | |
.\vcpkg integrate install | |
.\vcpkg install gsl gsl:x64-windows | |
$env:GSL_PATH = "${{ github.workspace }}\vcpkg\installed\x64-windows" | |
$env:INCLUDE = "$env:GSL_PATH\include;$env:INCLUDE" | |
$env:LIB = "$env:GSL_PATH\lib;$env:LIB" | |
echo "INCLUDE=$env:INCLUDE" >> $env:GITHUB_ENV | |
echo "LIB=$env:LIB" >> $env:GITHUB_ENV | |
echo "CONDA_PREFIX=$env:CONDA_PREFIX" >> $env:GITHUB_ENV | |
- name: Build wheels for Windows | |
if: runner.os == 'Windows' | |
uses: pypa/cibuildwheel@v2.21.1 | |
env: | |
CIBW_BUILD: ${{ matrix.python[1] }}-${{ matrix.buildplat[1] }} | |
CONDA_PREFIX: ${{ env.CONDA_PREFIX }} | |
with: | |
output-dir: wheelhouse | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.python[0] }}-${{ matrix.buildplat[0] }} | |
path: ./wheelhouse/*.whl |