fix: silence unused watch variable on non-windows builds #61
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |