Create codeql.yml #112
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
## IMPORTANT: the configuration for cibuildwheel is kept in pyproject.toml | |
name: wheels | |
on: [push, pull_request] | |
jobs: | |
generate-wheels-matrix: | |
name: Generate wheels matrix | |
runs-on: ubuntu-latest | |
outputs: | |
include: ${{ steps.set-matrix.outputs.include }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install cibuildwheel | |
run: pipx install cibuildwheel==2.12.0 | |
- id: set-matrix | |
run: | | |
MATRIX=$( | |
{ | |
cibuildwheel --print-build-identifiers --platform linux \ | |
| jq -nRc '{"only": inputs, "os": "ubuntu-latest"}' \ | |
&& cibuildwheel --print-build-identifiers --platform macos \ | |
| jq -nRc '{"only": inputs, "os": "macos-latest"}' \ | |
&& cibuildwheel --print-build-identifiers --platform windows \ | |
| jq -nRc '{"only": inputs, "os": "windows-latest"}' | |
} | jq -sc | |
) | |
echo "include=$MATRIX" >> $GITHUB_OUTPUT | |
build_wheels: | |
name: Build ${{ matrix.only }} | |
needs: generate-wheels-matrix | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: ${{ fromJson(needs.generate-wheels-matrix.outputs.include) }} | |
steps: | |
- uses: actions/checkout@v3 | |
# Used to host cibuildwheel | |
- uses: actions/setup-python@v3 | |
- name: Install cibuildwheel | |
run: python -m pip install cibuildwheel==2.11.2 | |
- name: Build wheels | |
uses: pypa/cibuildwheel@v2.12.0 | |
with: | |
package-dir: ./ | |
output-dir: ./wheelhouse | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: ./wheelhouse/*.whl | |