name: Build wheels

on:
  workflow_dispatch:
    inputs:
      runs-on:
        description: "The runner to use for the build"
        required: true
        type: string
        default: ubuntu-22.04
      python-version:
        description: "The Python version to use for the build"
        required: true
        type: string
      cuda-version:
        description: "The CUDA version to use for the build"
        required: true
        type: string
      torch-version:
        description: "The PyTorch version to use for the build"
        required: true
        type: string
      cxx11_abi:
        description: "Enable torch flag C++11 ABI (TRUE/FALSE)"
        required: true
        type: string
      upload-to-release:
        description: "Upload wheel to this release"
        required: false
        type: boolean
        default: false
      release-version:
        description: "Upload wheel to this release"
        required: false
        type: string

jobs:
  build-wheels:
    uses: ./.github/workflows/_build.yml
    with:
      runs-on: ${{ inputs.runs-on || 'ubuntu-22.04' }}
      python-version: ${{ inputs.python-version || '3.12' }}
      cuda-version: ${{ inputs.cuda-version || '12.9.1' }}
      torch-version: ${{ inputs.torch-version || '2.10.0' }}
      cxx11_abi: ${{ inputs.cxx11_abi || 'TRUE' }}
      upload-to-release: ${{ inputs.upload-to-release || false }}
      release-version: ${{ inputs.release-version || 'v2.2.6.post3' }}
