Skip to content

ci: build universal2 wheels #856

ci: build universal2 wheels

ci: build universal2 wheels #856

Workflow file for this run

name: Build
on:
push:
workflow_dispatch:
inputs:
save:
description: 'Save Wheels'
required: true
default: false
type: boolean
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macOS-11]
steps:
- uses: actions/github-script@v6
id: conan-path-script
env:
WORKSPACE: "${{github.workspace}}"
with:
result-encoding: string
script: |
const { WORKSPACE } = process.env
switch('${{runner.os}}'){
case 'Windows':
return `${WORKSPACE}\\ciwheelbuilder\\conan`;
case 'Linux':
return `/host/${WORKSPACE}/ciwheelbuilder/conan`
case 'macOS':
return `${WORKSPACE}/ciwheelbuilder/conan`
default:
return `${WORKSPACE}/ciwheelbuilder/conan`
}
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip' # caching pip dependencies
cache-dependency-path: |
requirements-cibuildwheel.txt
requirements/requirements-*.txt
# Used to host cibuildwheel
- name: Install cibuildwheel
run: python -m pip install -r requirements-cibuildwheel.txt
- uses: actions/cache@v3
id: cache-conan
with:
path: ${{github.workspace}}/ciwheelbuilder/conan
key: ${{ runner.os }}-${{ hashFiles('**/conanfile.py') }}
- name: Build wheels
if: contains(matrix.os, 'windows')
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
python -m cibuildwheel --output-dir wheelhouse
env:
CONAN_USER_HOME: ${{steps.conan-path-script.outputs.result}}
- name: Build wheels
if: "!contains(matrix.os, 'windows')"
run: python -m cibuildwheel --output-dir wheelhouse
env:
CONAN_USER_HOME: ${{steps.conan-path-script.outputs.result}}
# CIBW_SOME_OPTION: value
- uses: actions/upload-artifact@v3
if: ${{ inputs.save }}
with:
name: uiucprescon.ocr-wheels
path: ./wheelhouse/*.whl