Skip to content

Build

Build #1589

Workflow file for this run

name: Build
on:
push:
workflow_dispatch:
inputs:
save:
description: 'Save Wheels'
required: true
default: false
type: boolean
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-24.04, windows-latest, macOS-latest]
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
# Used to host cibuildwheel
- name: Install cibuildwheel
run: |
python -m pip install --disable-pip-version-check uv
- 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: |
"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 && uv run --only-group cibuildwheel --isolated cibuildwheel --output-dir wheelhouse
uv run --only-group conan --isolated conan cache clean
env:
CONAN_USER_HOME: ${{steps.conan-path-script.outputs.result}}
CONAN_HOME: ${{steps.conan-path-script.outputs.result}}\.conan2
- name: Build wheels
if: "!contains(matrix.os, 'windows')"
run: |
uv run --only-group cibuildwheel --isolated cibuildwheel --output-dir wheelhouse
env:
CONAN_USER_HOME: ${{steps.conan-path-script.outputs.result}}
CONAN_HOME: ${{steps.conan-path-script.outputs.result}}/.conan2
# CIBW_SOME_OPTION: value
- uses: actions/upload-artifact@v4
if: ${{ inputs.save }}
with:
name: uiucprescon.ocr-wheels
path: ./wheelhouse/*.whl