Repository navigation
correct deps #12
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: Release Workflow | ||
|
Check failure on line 1 in .github/workflows/release.yml
|
||
| on: | ||
| push: | ||
| tags: | ||
| - "*" | ||
| jobs: | ||
| build: | ||
| name: Build wheel | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: ["macos-14", "ubuntu-22.04", "windows-latest"] | ||
| runs-on: ${{ matrix.os }} | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| - name: Install CUDA 12.9 on Linux | ||
| if: runner.os == "Linux" | ||
| run: | | ||
| wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb | ||
| sudo dpkg -i cuda-keyring_1.1-1_all.deb | ||
| sudo apt-get update | ||
| sudo apt-get -y install cuda-nvcc-12-9 | ||
| echo "CUDA_HOME=/usr/local/cuda-12.9" >> $GITHUB_ENV | ||
| echo "/usr/local/cuda-12.9/bin" >> $GITHUB_PATH | ||
| - name: Install CUDA 12.9 on Windows | ||
| if: runner.os == "Windows" | ||
| shell: pwsh | ||
| run: | | ||
| $downloadUrl = "https://developer.download.nvidia.com/compute/cuda/12.9.1/local_installers/cuda_12.9.1_576.57_windows.exe" | ||
| $dst = "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.9" | ||
| New-Item -Path "cuda" -ItemType Directory | ||
| New-Item -Path $dst -ItemType Directory | ||
| & "C:\msys64\usr\bin\wget" $downloadUrl -O "cuda.exe" -q | ||
| & 'C:\Program Files\7-Zip\7z' x "cuda.exe" -o"cuda" | ||
| $directories = Get-ChildItem -Directory -Path "cuda" | ||
| foreach ($dir in $directories) { | ||
| $items = Get-ChildItem -Path (Join-Path "cuda" $dir.Name) | ||
| foreach ($item in $items) { | ||
| if ($item.PSIsContainer) { | ||
| Write-Output "$($item.FullName)" | ||
| Copy-Item -Path "$($item.FullName)\*" -Destination $dst -Recurse -Force | ||
| } | ||
| } | ||
| } | ||
| Write-Output "CUDA_HOME=$dst" >> $env:GITHUB_ENV | ||
| Write-Output "$dst\bin" >> $env:GITHUB_PATH | ||
| - name: Check CUDA installation | ||
| if: runner.os != "macOS" | ||
| shell: bash | ||
| run: | | ||
| nvcc -V | ||
| echo CUDA_HOME=$CUDA_HOME | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v5 | ||
| with: | ||
| version: "latest" | ||
| - name: Install dependencies on Linux and Windows | ||
| if: runner.os != "macOS" | ||
| run: | | ||
| uv venv | ||
| uv pip install setuptools numpy ninja | ||
| uv pip install torch --index-url https://download.pytorch.org/whl/nightly/cu129 | ||
| - name: Install dependencies on macOS | ||
| if: runner.os == "macOS" | ||
| run: | | ||
| uv venv | ||
| uv pip install setuptools numpy ninja | ||
| uv pip install torch --index-url https://download.pytorch.org/whl/nightly/cpu | ||
| - name: Build wheel | ||
| run: uv build --wheel --no-build-isolation | ||
| - name: Relabel the Linux wheel | ||
| if: runner.os == "Linux" | ||
| run: | | ||
| uvx --with patchelf auditwheel repair ./dist/*abi3-linux*.whl -w ./dist --plat manylinux_2_34_x86_64 --exclude "libtorch*" --exclude "libc10*" --exclude "libcu*" | ||
| rm ./dist/*abi3-linux*.whl | ||
| - name: Upload artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: dist-${{ matrix.os }} | ||
| path: ./dist/* | ||
| release: | ||
| name: Create release | ||
| needs: build | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v5 | ||
| with: | ||
| version: "latest" | ||
| - name: Download all artifacts | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| path: artifacts | ||
| - name: Move the artifacts | ||
| run: | | ||
| mkdir ./dist | ||
| mv ./artifacts/**/*.whl ./dist | ||
| - name: Build sdist | ||
| run: uv build --sdist | ||
| - name: List artifacts | ||
| run: find ./dist | ||
| - name: Create Release | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: gh release create "${GITHUB_REF#refs/tags/}" ./dist/* | ||
| - name: Upload to PyPI | ||
| run: uv publish -t ${{ secrets.PYPI_TOKEN }} | ||