-
Notifications
You must be signed in to change notification settings - Fork 14
363 lines (319 loc) · 13.3 KB
/
Copy pathrelease.yml
File metadata and controls
363 lines (319 loc) · 13.3 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
name: Build and Release
on:
push:
tags:
- 'v*'
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 samtools + bcftools via MSYS2 (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
- name: Stage tools and DLLs (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}
run: |
mkdir -p /c/yleaf-tools
for tool in samtools bcftools; do
cp /mingw64/bin/${tool}.exe /c/yleaf-tools/
ldd /mingw64/bin/${tool}.exe \
| grep '/mingw64' | awk '{print $3}' \
| while read f; do cp "$f" /c/yleaf-tools/ 2>/dev/null || true; done
done
echo "Staged $(ls /c/yleaf-tools | wc -l) files"
- name: Download minimap2 Windows binary (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$releases = gh release list --repo lh3/minimap2 --json tagName --limit 10 | ConvertFrom-Json
foreach ($rel in $releases) {
$assets = gh release view $rel.tagName --repo lh3/minimap2 --json assets | ConvertFrom-Json
$winAsset = $assets.assets | Where-Object { $_.name -match 'win' } | Select-Object -First 1
if ($winAsset) {
Write-Host "Found Windows binary in $($rel.tagName): $($winAsset.name)"
Invoke-WebRequest $winAsset.browserDownloadUrl -OutFile mm2-win.zip
Expand-Archive mm2-win.zip -DestinationPath C:/mm2-tmp
$exe = Get-ChildItem -Recurse C:/mm2-tmp -Filter "minimap2*.exe" | Select-Object -First 1
if ($exe) {
Copy-Item $exe.FullName "C:/yleaf-tools/minimap2.exe"
Write-Host "minimap2.exe staged"
}
break
}
}
if (-not (Test-Path "C:/yleaf-tools/minimap2.exe")) {
Write-Host "No Windows minimap2 binary found — FASTQ mode unavailable on Windows"
}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- 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 samtools + bcftools via MSYS2 (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
- name: Stage tools and DLLs (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}
run: |
mkdir -p /c/yleaf-tools
for tool in samtools bcftools; do
cp /mingw64/bin/${tool}.exe /c/yleaf-tools/
ldd /mingw64/bin/${tool}.exe \
| grep '/mingw64' | awk '{print $3}' \
| while read f; do cp "$f" /c/yleaf-tools/ 2>/dev/null || true; done
done
echo "Staged $(ls /c/yleaf-tools | wc -l) files"
- name: Download minimap2 Windows binary (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$releases = gh release list --repo lh3/minimap2 --json tagName --limit 10 | ConvertFrom-Json
foreach ($rel in $releases) {
$assets = gh release view $rel.tagName --repo lh3/minimap2 --json assets | ConvertFrom-Json
$winAsset = $assets.assets | Where-Object { $_.name -match 'win' } | Select-Object -First 1
if ($winAsset) {
Invoke-WebRequest $winAsset.browserDownloadUrl -OutFile mm2-win.zip
Expand-Archive mm2-win.zip -DestinationPath C:/mm2-tmp
$exe = Get-ChildItem -Recurse C:/mm2-tmp -Filter "minimap2*.exe" | Select-Object -First 1
if ($exe) { Copy-Item $exe.FullName "C:/yleaf-tools/minimap2.exe" }
break
}
}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- 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: |
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
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 (filenames may contain spaces from productName)
for f in *.AppImage *.deb *.dmg *.exe *.msi; do
[ -f "$f" ] && ASSETS+=("$f")
done
gh release create ${{ github.ref_name }} \
--title "Yleaf ${{ github.ref_name }}" \
--notes-file release_notes.txt \
"${ASSETS[@]}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}