-
Notifications
You must be signed in to change notification settings - Fork 14
418 lines (369 loc) · 15.1 KB
/
release.yml
File metadata and controls
418 lines (369 loc) · 15.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
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
name: Build and Release
on:
push:
tags:
- 'v*'
concurrency:
group: release-${{ github.ref_name }}
cancel-in-progress: true
jobs:
# ── CLI executables (PyInstaller --onedir, for command-line users) ──────────
build:
name: Build CLI on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
artifact: yleaf-linux.tar.gz
- os: macos-latest
artifact: yleaf-macos.tar.gz
- os: windows-latest
artifact: yleaf-windows.zip
steps:
- uses: actions/checkout@v4
# ── Linux / macOS ─────────────────────────────────────────────────────
- name: Set up Miniconda (Linux/macOS)
if: runner.os != 'Windows'
uses: conda-incubator/setup-miniconda@v3
with:
channels: conda-forge,bioconda,defaults
auto-activate: true
activate-environment: base
miniforge-version: latest
- name: Install tools (Linux/macOS)
if: runner.os != 'Windows'
shell: bash -el {0}
run: mamba install -y --strict-channel-priority samtools minimap2 bcftools
- name: Install Yleaf + PyInstaller (Linux/macOS)
if: runner.os != 'Windows'
shell: bash -el {0}
run: pip install -e . && pip install pyinstaller
- name: Build (Linux/macOS)
if: runner.os != 'Windows'
shell: bash -el {0}
run: python -m PyInstaller --distpath dist --workpath build --noconfirm pyinstaller_yleaf.spec
- name: Package (Linux/macOS)
if: runner.os != 'Windows'
shell: bash
run: tar czf ${{ matrix.artifact }} -C dist yleaf
# ── Windows ───────────────────────────────────────────────────────────
- name: Install MSYS2 packages (Windows)
if: runner.os == 'Windows'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: false
install: >-
mingw-w64-x86_64-samtools
mingw-w64-x86_64-bcftools
mingw-w64-x86_64-gcc
mingw-w64-x86_64-zlib
make
git
- name: Build minimap2 from source (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}
run: |
git clone --depth 1 --branch v2.28 https://github.com/lh3/minimap2.git /tmp/minimap2
cd /tmp/minimap2
make
# MinGW may or may not append .exe — normalise to minimap2.exe
if [ ! -f minimap2.exe ] && [ -f minimap2 ]; then mv minimap2 minimap2.exe; fi
ls -la minimap2.exe
- name: Stage tools and DLLs (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}
run: |
set +e # don't let a single missing dep kill the whole step
mkdir -p /c/yleaf-tools
cp /mingw64/bin/samtools.exe /c/yleaf-tools/
cp /mingw64/bin/bcftools.exe /c/yleaf-tools/
cp /tmp/minimap2/minimap2.exe /c/yleaf-tools/
for exe in /c/yleaf-tools/samtools.exe /c/yleaf-tools/bcftools.exe /c/yleaf-tools/minimap2.exe; do
for f in $(ldd "$exe" 2>/dev/null | grep '/mingw64' | awk '{print $3}'); do
cp "$f" /c/yleaf-tools/ 2>/dev/null
done
done
echo "Staged $(ls /c/yleaf-tools | wc -l) files:"
ls /c/yleaf-tools
- name: Install Graphviz and stage binaries (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
choco install graphviz -y --no-progress
$gv_bin = "C:\Program Files\Graphviz\bin"
Get-ChildItem "$gv_bin" | Copy-Item -Destination "C:\yleaf-tools\"
Write-Host "Graphviz staged. Total files in C:\yleaf-tools: $((Get-ChildItem C:\yleaf-tools).Count)"
- name: Verify bundled tools (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$required = @('samtools.exe', 'bcftools.exe', 'minimap2.exe', 'dot.exe')
$missing = @()
foreach ($exe in $required) {
if (-not (Test-Path "C:\yleaf-tools\$exe")) { $missing += $exe }
}
if ($missing.Count -gt 0) {
Write-Error "Missing required tools in C:\yleaf-tools: $($missing -join ', ')"
exit 1
}
Write-Host "All required tools staged."
- name: Set YLEAF_BUNDLED_TOOLS (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: echo "YLEAF_BUNDLED_TOOLS=C:/yleaf-tools" >> $env:GITHUB_ENV
- name: Set up Python (Windows)
if: runner.os == 'Windows'
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Yleaf + PyInstaller (Windows)
if: runner.os == 'Windows'
run: pip install -e . && pip install pyinstaller
- name: Build (Windows)
if: runner.os == 'Windows'
run: python -m PyInstaller --distpath dist --workpath build --noconfirm pyinstaller_yleaf.spec
- name: Package (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: Compress-Archive -Path dist\yleaf -DestinationPath ${{ matrix.artifact }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: ${{ matrix.artifact }}
# ── Dashboard (Tauri GUI, the default interface for end users) ──────────────
tauri-build:
name: Build Dashboard on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
tauri_target: x86_64-unknown-linux-gnu
- os: macos-latest
tauri_target: aarch64-apple-darwin
- os: windows-latest
tauri_target: x86_64-pc-windows-msvc
steps:
- uses: actions/checkout@v4
# ── Linux system deps (required by Tauri / WebKitGTK) ─────────────────
- name: Install Linux system dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
patchelf
# ── Install bioinformatics tools ─────────────────────────────────────
- name: Set up Miniconda (Linux/macOS)
if: runner.os != 'Windows'
uses: conda-incubator/setup-miniconda@v3
with:
channels: conda-forge,bioconda,defaults
auto-activate: true
activate-environment: base
miniforge-version: latest
- name: Install tools (Linux/macOS)
if: runner.os != 'Windows'
shell: bash -el {0}
run: mamba install -y --strict-channel-priority samtools minimap2 bcftools
- name: Install Yleaf + PyInstaller (Linux/macOS)
if: runner.os != 'Windows'
shell: bash -el {0}
run: pip install -e . && pip install pyinstaller
- name: Install MSYS2 packages (Windows)
if: runner.os == 'Windows'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: false
install: >-
mingw-w64-x86_64-samtools
mingw-w64-x86_64-bcftools
mingw-w64-x86_64-gcc
mingw-w64-x86_64-zlib
make
git
- name: Build minimap2 from source (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}
run: |
git clone --depth 1 --branch v2.28 https://github.com/lh3/minimap2.git /tmp/minimap2
cd /tmp/minimap2
make
# MinGW may or may not append .exe — normalise to minimap2.exe
if [ ! -f minimap2.exe ] && [ -f minimap2 ]; then mv minimap2 minimap2.exe; fi
ls -la minimap2.exe
- name: Stage tools and DLLs (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}
run: |
set +e # don't let a single missing dep kill the whole step
mkdir -p /c/yleaf-tools
cp /mingw64/bin/samtools.exe /c/yleaf-tools/
cp /mingw64/bin/bcftools.exe /c/yleaf-tools/
cp /tmp/minimap2/minimap2.exe /c/yleaf-tools/
for exe in /c/yleaf-tools/samtools.exe /c/yleaf-tools/bcftools.exe /c/yleaf-tools/minimap2.exe; do
for f in $(ldd "$exe" 2>/dev/null | grep '/mingw64' | awk '{print $3}'); do
cp "$f" /c/yleaf-tools/ 2>/dev/null
done
done
echo "Staged $(ls /c/yleaf-tools | wc -l) files:"
ls /c/yleaf-tools
- name: Install Graphviz and stage binaries (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
choco install graphviz -y --no-progress
$gv_bin = "C:\Program Files\Graphviz\bin"
Get-ChildItem "$gv_bin" | Copy-Item -Destination "C:\yleaf-tools\"
Write-Host "Graphviz staged. Total files in C:\yleaf-tools: $((Get-ChildItem C:\yleaf-tools).Count)"
- name: Verify bundled tools (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$required = @('samtools.exe', 'bcftools.exe', 'minimap2.exe', 'dot.exe')
$missing = @()
foreach ($exe in $required) {
if (-not (Test-Path "C:\yleaf-tools\$exe")) { $missing += $exe }
}
if ($missing.Count -gt 0) {
Write-Error "Missing required tools in C:\yleaf-tools: $($missing -join ', ')"
exit 1
}
Write-Host "All required tools staged."
- name: Set YLEAF_BUNDLED_TOOLS (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: echo "YLEAF_BUNDLED_TOOLS=C:/yleaf-tools" >> $env:GITHUB_ENV
- name: Set up Python (Windows)
if: runner.os == 'Windows'
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Yleaf + PyInstaller (Windows)
if: runner.os == 'Windows'
run: pip install -e . && pip install pyinstaller
# ── Build the PyInstaller sidecar ─────────────────────────────────────
- name: Build sidecar (Linux/macOS)
if: runner.os != 'Windows'
shell: bash -el {0}
run: |
python -m PyInstaller \
--distpath /tmp/sidecar-dist \
--workpath /tmp/sidecar-build \
--noconfirm \
dashboard/pyinstaller_yleaf.spec
mkdir -p dashboard/src-tauri/binaries
cp /tmp/sidecar-dist/yleaf dashboard/src-tauri/binaries/yleaf-${{ matrix.tauri_target }}
chmod +x dashboard/src-tauri/binaries/yleaf-${{ matrix.tauri_target }}
- name: Build sidecar (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
python -m PyInstaller `
--distpath C:\sidecar-dist `
--workpath C:\sidecar-build `
--noconfirm `
dashboard\pyinstaller_yleaf.spec
New-Item -ItemType Directory -Force -Path dashboard\src-tauri\binaries
Copy-Item C:\sidecar-dist\yleaf.exe `
dashboard\src-tauri\binaries\yleaf-${{ matrix.tauri_target }}.exe
# ── Install Node.js + Rust, build Tauri app ───────────────────────────
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: Install npm dependencies
working-directory: dashboard
run: npm ci
- name: Build Tauri app (Linux/macOS)
if: runner.os != 'Windows'
working-directory: dashboard
shell: bash -el {0}
run: npm run tauri build
- name: Build Tauri app (Windows)
if: runner.os == 'Windows'
working-directory: dashboard
run: npm run tauri build
# ── Collect and upload installer artifacts ────────────────────────────
- name: Upload Linux installers
if: runner.os == 'Linux'
uses: actions/upload-artifact@v4
with:
name: dashboard-linux
path: |
dashboard/src-tauri/target/release/bundle/appimage/*.AppImage
dashboard/src-tauri/target/release/bundle/deb/*.deb
- name: Upload macOS installer
if: runner.os == 'macOS'
uses: actions/upload-artifact@v4
with:
name: dashboard-macos
path: dashboard/src-tauri/target/release/bundle/dmg/*.dmg
- name: Upload Windows installers
if: runner.os == 'Windows'
uses: actions/upload-artifact@v4
with:
name: dashboard-windows
path: |
dashboard/src-tauri/target/release/bundle/nsis/*.exe
dashboard/src-tauri/target/release/bundle/msi/*.msi
# ── Create GitHub Release with all artifacts ───────────────────────────────
release:
name: Create GitHub Release
needs: [build, tauri-build]
if: always()
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Generate changelog
run: |
NOTES_FILE="release_notes_${{ github.ref_name }}.md"
if [ -f "$NOTES_FILE" ]; then
cp "$NOTES_FILE" release_notes.txt
else
PREV=$(git tag --sort=-v:refname | sed -n '2p')
RANGE="${PREV:+${PREV}..}HEAD"
git log $RANGE --pretty=format:"- %s" \
| grep -v "Co-Authored-By" > release_notes.txt
fi
cat release_notes.txt
- name: Publish release
run: |
ASSETS=()
# CLI executables
[ -f yleaf-linux.tar.gz ] && ASSETS+=("yleaf-linux.tar.gz")
[ -f yleaf-macos.tar.gz ] && ASSETS+=("yleaf-macos.tar.gz")
[ -f yleaf-windows.zip ] && ASSETS+=("yleaf-windows.zip")
# Dashboard installers — search recursively because upload-artifact@v4
# preserves subdirectory structure when multiple paths are specified
while IFS= read -r -d '' f; do
ASSETS+=("$f")
done < <(find . \( -name "*.AppImage" -o -name "*.deb" -o -name "*.dmg" -o -name "*.exe" -o -name "*.msi" \) -print0)
if gh release view ${{ github.ref_name }} &>/dev/null; then
gh release upload ${{ github.ref_name }} "${ASSETS[@]}" --clobber
else
gh release create ${{ github.ref_name }} \
--title "Yleaf ${{ github.ref_name }}" \
--notes-file release_notes.txt \
"${ASSETS[@]}"
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}