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
name: Windows Release
on:
workflow_dispatch:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build-windows-release:
runs-on: windows-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust build outputs
uses: Swatinem/rust-cache@v2
- name: Restore voice model assets cache
uses: actions/cache/restore@v4
id: cache-voice
with:
path: .hematite/assets/voice
key: kokoro-voice-assets-v1.0
restore-keys: |
kokoro-voice-assets-
- name: Download voice model assets
shell: powershell
run: |
$assetsDir = ".hematite\assets\voice"
New-Item -ItemType Directory -Force -Path $assetsDir | Out-Null
$base = "https://github.com/thewh1teagle/kokoro-onnx/releases/download/model-files-v1.0"
if (-not (Test-Path "$assetsDir\kokoro-v1.0.onnx")) {
Invoke-WebRequest -Uri "$base/kokoro-v1.0.onnx" -OutFile "$assetsDir\kokoro-v1.0.onnx" -TimeoutSec 300
}
if (-not (Test-Path "$assetsDir\voices.bin")) {
Invoke-WebRequest -Uri "$base/voices-v1.0.bin" -OutFile "$assetsDir\voices.bin" -TimeoutSec 120
}
- name: Save voice model assets cache
if: always() && steps.cache-voice.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: .hematite/assets/voice
key: kokoro-voice-assets-v1.0
- name: Install Inno Setup
shell: powershell
run: choco install innosetup -y --no-progress
- name: Build portable bundle and installer
shell: powershell
run: |
$maxAttempts = 3
for ($attempt = 1; $attempt -le $maxAttempts; $attempt++) {
Write-Host "Build attempt $attempt..."
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\package-windows.ps1 -Installer
if ($LASTEXITCODE -eq 0) { break }
if ($attempt -lt $maxAttempts) {
Write-Host "Build failed (attempt $attempt), retrying in 30s..."
Start-Sleep -Seconds 30
} else {
Write-Host "All build attempts failed."
exit 1
}
}
- name: Upload packaged artifacts
uses: actions/upload-artifact@v4
with:
name: hematite-windows
path: |
dist/windows/*.zip
dist/windows/*-Setup.exe
- name: Publish GitHub release assets
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: |
dist/windows/*.zip
dist/windows/*-Setup.exe