Skip to content

fix: use MSVC on Windows, fix cstring errors #4

fix: use MSVC on Windows, fix cstring errors

fix: use MSVC on Windows, fix cstring errors #4

# Core Library Build
# Backend plugins have their own workflows in their respective repos
name: Build Core Library
on:
push:
branches: [main, release/*]
tags: ['v*']
pull_request:
branches: [main]
env:
CMAKE_BUILD_TYPE: Release
jobs:
build-core:
strategy:
matrix:
include:
- os: ubuntu-22.04
arch: x86_64
artifact: linux-x86_64
- os: macos-14
arch: arm64
artifact: macos-arm64
- os: windows-2022
arch: x86_64
artifact: windows-x86_64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y cmake ninja-build
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: brew install cmake ninja
- name: Configure (Unix)
if: runner.os != 'Windows'
run: cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
- name: Configure (Windows)
if: runner.os == 'Windows'
run: cmake -B build -DCMAKE_BUILD_TYPE=Release
- name: Build
run: cmake --build build --config Release
- name: Package
run: |
mkdir -p dist
cp build/libluxgpu_core* dist/ 2>/dev/null || cp build/Release/luxgpu_core* dist/ 2>/dev/null || true
cp -r include dist/
tar -czvf luxgpu-core-${{ matrix.artifact }}.tar.gz -C dist .
shell: bash
- uses: actions/upload-artifact@v4
with:
name: luxgpu-core-${{ matrix.artifact }}
path: luxgpu-core-${{ matrix.artifact }}.tar.gz
release:
needs: [build-core]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
path: artifacts
- name: Prepare release
run: |
mkdir release
find artifacts -name "*.tar.gz" -exec cp {} release/ \;
cd release && sha256sum * > SHA256SUMS
- name: Generate release notes
run: |
cat > RELEASE_NOTES.md << 'EOF'
# luxgpu-core ${{ github.ref_name }}
Core GPU acceleration library (ABI + loader + CPU backend).
## Downloads
| Platform | File |
|----------|------|
| Linux x86_64 | `luxgpu-core-linux-x86_64.tar.gz` |
| macOS arm64 | `luxgpu-core-macos-arm64.tar.gz` |
| Windows x86_64 | `luxgpu-core-windows-x86_64.tar.gz` |
## Backend Plugins
Download backend plugins from their respective repos:
- CUDA: [luxcpp/cuda](https://github.com/luxcpp/cuda/releases)
- Metal: [luxcpp/metal](https://github.com/luxcpp/metal/releases)
- WebGPU: [luxcpp/webgpu](https://github.com/luxcpp/webgpu/releases)
EOF
- uses: softprops/action-gh-release@v2
with:
files: release/*
body_path: RELEASE_NOTES.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}