-
-
Notifications
You must be signed in to change notification settings - Fork 71
182 lines (155 loc) · 7.31 KB
/
linux_special.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
name: Linux with Vulkan, Cuda and Rocm
on:
workflow_dispatch:
inputs:
skip-publish:
description: 'Skip publish'
required: false
default: '0'
jobs:
publish-tauri:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
# Ubuntu 22.04
- platform: "ubuntu-22.04"
args: '--features "vulkan"'
pre-build-args: "--vulkan"
rust-version: "stable"
name: "ubuntu-22.04"
# Ubuntu 22.04 cuda
# - platform: "ubuntu-22.04"
# args: '--features "cuda"'
# pre-build-args: "--cuda"
# rust-version: "stable"
# cuda-version: "12.4.1"
# name: "ubuntu-22.04-nvidia-12"
# Ubuntu 24.04 cuda
# https://github.com/Jimver/cuda-toolkit/issues/365
# - platform: "ubuntu-24.04"
# args: '--features "cuda"'
# pre-build-args: "--cuda"
# rust-version: "stable"
# cuda-version: "12.4.1"
# name: "ubuntu-24.04-nvidia-12"
# Ubuntu 22.04 rocm
# - platform: "ubuntu-22.04"
# args: '--features "rocm"'
# rocm-version: "6.1.2"
# pre-build-args: "--rocm"
# rust-version: "stable"
# name: "ubuntu-24.04-rocm-6.1.2"
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: Free Disk Space (Ubuntu) for Rocm
if: contains(matrix.args, 'rocm')
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Prepare Vulkan SDK for Windows
run: |
C:\msys64\usr\bin\wget.exe https://sdk.lunarg.com/sdk/download/1.3.290.0/windows/VulkanSDK-1.3.290.0-Installer.exe -O vulkan.exe
.\vulkan.exe --root C:\vulkan --accept-licenses --default-answer --confirm-command install
echo "VULKAN_SDK=C:\vulkan" >> $env:GITHUB_ENV
Copy-Item -Path "C:\vulkan\Bin\*.dll" -Destination "." -Recurse
if: ${{ contains(matrix.platform, 'windows') && contains(matrix.args, 'vulkan') }}
- name: Prepare Vulkan SDK for Ubuntu 24.04
run: |
wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo tee /etc/apt/trusted.gpg.d/lunarg.asc
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-noble.list http://packages.lunarg.com/vulkan/lunarg-vulkan-noble.list
sudo apt update
sudo apt install vulkan-sdk -y
sudo apt-get install -y mesa-vulkan-drivers
if: ${{ contains(matrix.platform, 'ubuntu-24.04') && contains(matrix.args, 'vulkan') }}
- name: Prepare Vulkan SDK for Ubuntu 22.04
run: |
wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo tee /etc/apt/trusted.gpg.d/lunarg.asc
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-1.3.290-jammy.list https://packages.lunarg.com/vulkan/1.3.290/lunarg-vulkan-1.3.290-jammy.list
sudo apt update
sudo apt install vulkan-sdk -y
sudo apt-get install -y mesa-vulkan-drivers
if: ${{ contains(matrix.platform, 'ubuntu-22.04') && contains(matrix.args, 'vulkan') }}
- name: Install rocm
if: contains(matrix.args, 'rocm')
run: |
wget https://repo.radeon.com/amdgpu-install/${{ matrix.rocm-version }}/ubuntu/jammy/amdgpu-install_6.1.60102-1_all.deb
sudo apt install -y ./amdgpu-install_6.1.60102-1_all.deb
sudo apt update
sudo apt install -y rocm
- uses: Jimver/[email protected]
if: contains(matrix.args, 'cuda')
id: cuda-toolkit
with:
cuda: ${{ matrix.cuda-version }}
method: 'network'
- name: setup Bun
uses: oven-sh/setup-bun@v1
# - name: Rust cache
# uses: swatinem/rust-cache@v2
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: Install frontend dependencies
run: bun install
working-directory: ./desktop
- name: Cache Pre Build
id: cache-pre-build
uses: actions/cache@v4
with:
path: |
desktop/src-tauri/openblas
desktop/src-tauri/clblast
desktop/src-tauri/ffmpeg
key: ${{ runner.os }}-pre-build
# Run pre build
- name: Run pre_build.js
run: bun scripts/pre_build.js ${{ matrix.pre-build-args }}
- name: Build
uses: tauri-apps/tauri-action@v0
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
INPUT_CUDA_VERSION: ${{ matrix.cuda-version }}
INPUT_ROCM_VERSION: ${{ matrix.cuda-version }}
with:
projectPath: "./desktop"
tauriScript: bunx tauri
args: ${{ matrix.args }}
- name: Rename installer
run: |
# Rename .deb files
for file in target/release/bundle/deb/*.deb; do
name=$(basename "$file" .deb)
new_name="${name}_${{ matrix.name }}.deb"
mv "$file" "target/release/bundle/deb/$new_name"
echo "Renamed '$file' to '$new_name'"
done
# Rename .rpm files
for file in target/release/bundle/rpm/*.rpm; do
name=$(basename "$file" .rpm)
new_name="${name}_${{ matrix.name }}.rpm"
mv "$file" "target/release/bundle/rpm/$new_name"
echo "Renamed '$file' to '$new_name'"
done
shell: bash
- name: Upload installer
if: github.event.inputs.skip-publish != '1'
run: |
bun scripts/publish.js target/release/bundle/deb/*.deb
bun scripts/publish.js target/release/bundle/rpm/*.rpm
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}