-
Notifications
You must be signed in to change notification settings - Fork 36
291 lines (251 loc) · 10.1 KB
/
build-linux.yml
File metadata and controls
291 lines (251 loc) · 10.1 KB
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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
name: Build Linux
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
version:
description: 'Version (without v prefix)'
required: true
default: '0.5.0'
jobs:
# AVX2 build - uses Docker for clean toolchain (no AVX-512 contamination)
build-avx2:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Determine version
id: version
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
else
echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
fi
- name: Build AVX2 binary in Docker
run: |
VERSION=${{ steps.version.outputs.version }}
docker build -f Dockerfile.build -t voxtype-avx2 --build-arg VERSION=${VERSION} .
mkdir -p releases/${VERSION}
docker run --rm -v $(pwd)/releases/${VERSION}:/output voxtype-avx2
- name: Verify binary
run: |
VERSION=${{ steps.version.outputs.version }}
releases/${VERSION}/voxtype-${VERSION}-linux-x86_64-avx2 --version
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: linux-avx2
path: releases/${{ steps.version.outputs.version }}/voxtype-*-linux-x86_64-avx2
# Vulkan build - uses Docker for clean toolchain
build-vulkan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Determine version
id: version
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
else
echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
fi
- name: Build Vulkan binary in Docker
run: |
VERSION=${{ steps.version.outputs.version }}
docker build -f Dockerfile.vulkan -t voxtype-vulkan --build-arg VERSION=${VERSION} .
mkdir -p releases/${VERSION}
docker run --rm -v $(pwd)/releases/${VERSION}:/output voxtype-vulkan
- name: Verify binary
run: |
VERSION=${{ steps.version.outputs.version }}
releases/${VERSION}/voxtype-${VERSION}-linux-x86_64-vulkan --version
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: linux-vulkan
path: releases/${{ steps.version.outputs.version }}/voxtype-*-linux-x86_64-vulkan
# Parakeet AVX2 build - uses Docker for clean toolchain
build-parakeet-avx2:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Determine version
id: version
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
else
echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
fi
- name: Build Parakeet AVX2 binary in Docker
run: |
VERSION=${{ steps.version.outputs.version }}
docker build -f Dockerfile.parakeet -t voxtype-parakeet-avx2 --build-arg VERSION=${VERSION} .
mkdir -p releases/${VERSION}
docker run --rm -v $(pwd)/releases/${VERSION}:/output voxtype-parakeet-avx2
- name: Verify binary
run: |
VERSION=${{ steps.version.outputs.version }}
releases/${VERSION}/voxtype-${VERSION}-linux-x86_64-parakeet-avx2 --version
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: linux-parakeet-avx2
path: releases/${{ steps.version.outputs.version }}/voxtype-*-linux-x86_64-parakeet-avx2
# AVX-512 build - requires AVX-512 capable runner (best effort)
build-avx512:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check for AVX-512 support
id: check-avx512
run: |
if grep -q avx512f /proc/cpuinfo; then
echo "supported=true" >> $GITHUB_OUTPUT
echo "AVX-512 is supported on this runner"
else
echo "supported=false" >> $GITHUB_OUTPUT
echo "AVX-512 is NOT supported on this runner - skipping build"
fi
- name: Determine version
if: steps.check-avx512.outputs.supported == 'true'
id: version
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
else
echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
fi
- name: Install Rust
if: steps.check-avx512.outputs.supported == 'true'
uses: dtolnay/rust-toolchain@stable
- name: Install dependencies
if: steps.check-avx512.outputs.supported == 'true'
run: |
sudo apt-get update
sudo apt-get install -y libasound2-dev libclang-dev cmake \
libgtk-3-dev libglib2.0-dev libx11-dev libxi-dev libxtst-dev
- name: Build AVX-512 binary
if: steps.check-avx512.outputs.supported == 'true'
env:
RUSTFLAGS: "-C target-cpu=native"
run: |
cargo build --release
VERSION=${{ steps.version.outputs.version }}
mkdir -p releases/${VERSION}
cp target/release/voxtype releases/${VERSION}/voxtype-${VERSION}-linux-x86_64-avx512
- name: Verify binary
if: steps.check-avx512.outputs.supported == 'true'
run: |
VERSION=${{ steps.version.outputs.version }}
releases/${VERSION}/voxtype-${VERSION}-linux-x86_64-avx512 --version
- name: Upload artifact
if: steps.check-avx512.outputs.supported == 'true'
uses: actions/upload-artifact@v4
with:
name: linux-avx512
path: releases/${{ steps.version.outputs.version }}/voxtype-*-linux-x86_64-avx512
# Parakeet AVX-512 build - requires AVX-512 capable runner (best effort)
build-parakeet-avx512:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check for AVX-512 support
id: check-avx512
run: |
if grep -q avx512f /proc/cpuinfo; then
echo "supported=true" >> $GITHUB_OUTPUT
echo "AVX-512 is supported on this runner"
else
echo "supported=false" >> $GITHUB_OUTPUT
echo "AVX-512 is NOT supported on this runner - skipping build"
fi
- name: Determine version
if: steps.check-avx512.outputs.supported == 'true'
id: version
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
else
echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
fi
- name: Install Rust
if: steps.check-avx512.outputs.supported == 'true'
uses: dtolnay/rust-toolchain@stable
- name: Install dependencies
if: steps.check-avx512.outputs.supported == 'true'
run: |
sudo apt-get update
sudo apt-get install -y libasound2-dev libclang-dev cmake \
libgtk-3-dev libglib2.0-dev libx11-dev libxi-dev libxtst-dev \
libssl-dev protobuf-compiler libprotobuf-dev
- name: Build Parakeet AVX-512 binary
if: steps.check-avx512.outputs.supported == 'true'
env:
RUSTFLAGS: "-C target-cpu=native"
run: |
cargo build --release --features parakeet
VERSION=${{ steps.version.outputs.version }}
mkdir -p releases/${VERSION}
cp target/release/voxtype releases/${VERSION}/voxtype-${VERSION}-linux-x86_64-parakeet-avx512
- name: Verify binary
if: steps.check-avx512.outputs.supported == 'true'
run: |
VERSION=${{ steps.version.outputs.version }}
releases/${VERSION}/voxtype-${VERSION}-linux-x86_64-parakeet-avx512 --version
- name: Upload artifact
if: steps.check-avx512.outputs.supported == 'true'
uses: actions/upload-artifact@v4
with:
name: linux-parakeet-avx512
path: releases/${{ steps.version.outputs.version }}/voxtype-*-linux-x86_64-parakeet-avx512
# Collect all artifacts and create release
release:
needs: [build-avx2, build-vulkan, build-parakeet-avx2, build-avx512, build-parakeet-avx512]
if: always() && needs.build-avx2.result == 'success'
runs-on: ubuntu-latest
steps:
- name: Determine version
id: version
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
else
echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
fi
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Collect binaries
run: |
VERSION=${{ steps.version.outputs.version }}
mkdir -p releases/${VERSION}
# Move all binaries to releases directory
find artifacts -name 'voxtype-*' -type f -exec mv {} releases/${VERSION}/ \;
# List collected binaries
echo "Collected binaries:"
ls -la releases/${VERSION}/
- name: Generate checksums
run: |
VERSION=${{ steps.version.outputs.version }}
cd releases/${VERSION}
sha256sum voxtype-* > SHA256SUMS.txt
echo "Checksums:"
cat SHA256SUMS.txt
- name: Upload combined artifact
uses: actions/upload-artifact@v4
with:
name: linux-release-all
path: |
releases/${{ steps.version.outputs.version }}/voxtype-*
releases/${{ steps.version.outputs.version }}/SHA256SUMS.txt
- name: Upload to release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: |
releases/${{ steps.version.outputs.version }}/voxtype-*
releases/${{ steps.version.outputs.version }}/SHA256SUMS.txt