fix: bundle CUDA DLL into the release #2
This file contains 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: CI | |
on: | |
push: | |
branches: | |
- main | |
- master | |
tags: | |
- "*" | |
pull_request: | |
workflow_dispatch: | |
permissions: | |
contents: write | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
linux: | |
strategy: | |
fail-fast: false | |
matrix: | |
accelerator: ["cublas", "clblast"] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Rust cache | |
uses: swatinem/rust-cache@v2 | |
with: | |
workspaces: "./apps/desktop/src-tauri -> target" | |
- name: Install Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Setup pnpm | |
uses: pnpm/[email protected] | |
with: | |
version: "latest" | |
run_install: false | |
- name: Get pnpm store directory | |
id: pnpm-cache | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- name: Install CLBlast on linux | |
if: matrix.accelerator == 'clblast' | |
run: sudo apt install libclblast-dev | |
- uses: Jimver/[email protected] | |
name: Install CUDA toolkit on Linux | |
if: matrix.accelerator == 'cublas' | |
id: cuda-toolkit-linux | |
with: | |
cuda: "12.2.0" | |
method: "network" | |
#See e.g. https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/ | |
non-cuda-sub-packages: '["libcublas","libcublas-dev"]' | |
sub-packages: '["nvcc","compiler","libraries","libraries-dev","cudart","cudart-dev"]' | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: run pnpm | |
run: | | |
pnpm i | |
pnpm build:sdk | |
- name: Change directory to tauri path | |
run: | | |
cd apps | |
cd desktop | |
- name: Get release infos | |
id: release_infos | |
run: | | |
echo "::set-output name=release_body::${{ github.event.release.body || 'Default release body' }}" | |
echo "::set-output name=release_id::${{ github.event.release.id || 'default_id' }}" | |
echo "::set-output name=tag_name::${{ github.event.release.tag_name || 'default_tag' }}" | |
- name: Build the app | |
id: tauri_action | |
uses: tauri-apps/tauri-action@dev | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} | |
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} | |
ENABLE_CODE_SIGNING: ${{ secrets.APPLE_CERTIFICATE }} | |
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} | |
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} | |
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }} | |
APPLE_ID: ${{ secrets.APPLE_ID }} | |
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }} | |
APPLE_PROVIDER_SHORT_NAME: ${{ secrets.APPLE_PROVIDER_SHORT_NAME }} | |
with: | |
prerelease: false | |
releaseDraft: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
releaseName: "v__VERSION__" | |
releaseBody: ${{ steps.release_infos.outputs.release_body }} | |
releaseId: ${{ steps.release_infos.outputs.release_id }} | |
tagName: ${{ steps.release_infos.outputs.tag_name }} | |
args: "--features ${{ matrix.accelerator }}" | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: artifacts | |
path: ${{steps.tauri_action.outputs.artifactPaths}} |