Skip to content

test

test #18

name: Build and Release
on:
push:
branches: [main, ci]
pull_request:
branches: [main]
workflow_dispatch: {} # Allow manual trigger
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build-with-cuda:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install cibuildwheel
run: pip install cibuildwheel
- name: Build wheels with cibuildwheel
run: cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-*"
CIBW_SKIP: "pp* *-win32 *-manylinux_i686 *-musllinux*"
CIBW_MANYLINUX_X86_64_IMAGE: "pytorch/pytorch:2.6.0-cuda12.6-cudnn9-devel"
CIBW_BEFORE_BUILD: >
apt-get update && apt-get install -y --no-install-recommends cmake ninja-build git &&
NVCC_PATH=$(which nvcc) &&
export CUDA_HOME=$(dirname $(dirname $NVCC_PATH)) &&
echo "Found CUDA installation at: ${CUDA_HOME}" &&
export PATH="${CUDA_HOME}/bin:$PATH" &&
nvcc -V &&
echo "CUDA_HOME: ${CUDA_HOME}" &&
ls -la ${CUDA_HOME}/bin
CIBW_ENVIRONMENT: "CUDA_PATH=${CUDA_HOME}"
CIBW_TEST_COMMAND: ""
CIBW_TEST_SKIP: "*"
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: wheel
path: wheelhouse/*.whl
retention-days: 7
publish-release:
needs: build-with-cuda
runs-on: ubuntu-latest
# if: github.ref == 'refs/heads/main' # Only run on main branch
permissions:
contents: write
steps:
- name: Download wheel artifacts
uses: actions/download-artifact@v4
with:
name: wheel
path: wheels/
- name: List wheels
run: ls -la wheels/
- name: Create/Update Release
uses: softprops/action-gh-release@v2.0.8
with:
files: wheels/*.whl
prerelease: true
name: Latest Build from main
tag_name: latest-release
make_latest: true
draft: false
target_commitish: ${{ github.sha }}