97 lines
4.1 KiB
YAML
97 lines
4.1 KiB
YAML
name: Windows Installer bauen
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- 'tauri-app/**'
|
|
- '.github/workflows/build.yml'
|
|
tags:
|
|
- 'v*.*.*'
|
|
workflow_dispatch: {}
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build-windows:
|
|
runs-on: windows-latest
|
|
env:
|
|
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
|
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
|
|
steps:
|
|
- name: Code auschecken
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Node.js einrichten
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
|
|
- name: Rust einrichten
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
- name: Node Abhängigkeiten installieren
|
|
working-directory: tauri-app
|
|
run: npm install
|
|
|
|
- name: Sidecar Werkzeuge herunterladen (auto-editor, DeepFilterNet, FFmpeg)
|
|
shell: pwsh
|
|
run: |
|
|
$ErrorActionPreference = "Stop"
|
|
$binDir = "tauri-app/src-tauri/binaries"
|
|
New-Item -ItemType Directory -Force -Path $binDir | Out-Null
|
|
$triple = "x86_64-pc-windows-msvc"
|
|
|
|
Write-Host "Lade auto-editor..."
|
|
Invoke-WebRequest -Uri "https://github.com/WyattBlue/auto-editor/releases/latest/download/auto-editor-windows-x86_64.exe" `
|
|
-OutFile "$binDir/auto-editor-$triple.exe"
|
|
|
|
Write-Host "Lade FFmpeg (gyan.dev essentials build)..."
|
|
Invoke-WebRequest -Uri "https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-essentials.zip" -OutFile "ffmpeg.zip"
|
|
Expand-Archive -Path "ffmpeg.zip" -DestinationPath "ffmpeg-extracted"
|
|
$ffmpegExe = Get-ChildItem -Path "ffmpeg-extracted" -Recurse -Filter "ffmpeg.exe" | Select-Object -First 1
|
|
Copy-Item $ffmpegExe.FullName "$binDir/ffmpeg-$triple.exe"
|
|
|
|
Write-Host "Ermittle aktuelle DeepFilterNet Windows Datei..."
|
|
$release = Invoke-RestMethod -Uri "https://api.github.com/repos/Rikorose/DeepFilterNet/releases/latest" -Headers @{ "User-Agent" = "novaphonic-build" }
|
|
$winAsset = $release.assets | Where-Object { $_.name -match "(?i)win" -and $_.name -match "(?i)deep-filter" } | Select-Object -First 1
|
|
if (-not $winAsset) {
|
|
Write-Error "Kein passendes DeepFilterNet Windows Asset in der aktuellen Release gefunden. Bitte https://github.com/Rikorose/DeepFilterNet/releases manuell pruefen und diesen Schritt anpassen."
|
|
}
|
|
Write-Host "Gefunden: $($winAsset.name)"
|
|
Invoke-WebRequest -Uri $winAsset.browser_download_url -OutFile "deepfilter-download"
|
|
if ($winAsset.name -match "\.zip$") {
|
|
Expand-Archive -Path "deepfilter-download" -DestinationPath "deepfilter-extracted"
|
|
$dfExe = Get-ChildItem -Path "deepfilter-extracted" -Recurse -Filter "*.exe" | Select-Object -First 1
|
|
Copy-Item $dfExe.FullName "$binDir/deep-filter-$triple.exe"
|
|
} else {
|
|
Copy-Item "deepfilter-download" "$binDir/deep-filter-$triple.exe"
|
|
}
|
|
|
|
- name: Nur bauen, kein Release (normaler Push ohne Versions-Tag)
|
|
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
|
|
working-directory: tauri-app
|
|
run: npm run tauri build
|
|
|
|
- name: Installer als Artefakt hochladen (nur bei normalem Push)
|
|
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: novaphonic-windows-installer
|
|
path: |
|
|
tauri-app/src-tauri/target/release/bundle/nsis/*.exe
|
|
|
|
- name: Bauen, signieren und GitHub Release veröffentlichen (nur bei Versions-Tag)
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
uses: tauri-apps/tauri-action@v0
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
projectPath: tauri-app
|
|
tagName: ${{ github.ref_name }}
|
|
releaseName: 'NovaPhonic ${{ github.ref_name }}'
|
|
releaseBody: 'Automatisch erstelltes Release. Enthält den Windows Installer sowie das Update Manifest für die In App Aktualisierung.'
|
|
releaseDraft: false
|
|
prerelease: false
|
|
includeUpdaterJson: true
|