WIP CI for wheel build #10
This file contains hidden or 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: Build Wheel | |
| on: | |
| push: | |
| branches: [ wheel-build ] | |
| release: | |
| types: [ published ] | |
| branches: [ master ] | |
| workflow_dispatch: | |
| jobs: | |
| build-cuda: | |
| runs-on: ubuntu-latest | |
| env: | |
| TORCH_CUDA_ARCH_LIST: "8.6 8.7 9.0+PTX" | |
| FORCE_CUDA: 1 | |
| SAM2_BUILD_ALLOW_ERRORS: 0 | |
| SAM2_BUILD_CUDA: 1 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: | | |
| apt-get update | |
| apt-get install -y git build-essential cuda-compiler-12-6 cuda-cudart-dev-12-6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.10" | |
| - name: Install PyTorch | |
| run: | | |
| python -m pip install torch torchvision --index-url https://download.pytorch.org/whl/cu126 | |
| - name: Check CUDA version | |
| run: | | |
| nvcc --version | |
| - name: Build package | |
| run: | | |
| python -m build --wheel | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: built-wheel | |
| path: dist/*.whl |