From 966c593c8a1036450c0df9e7c786d28275c051d4 Mon Sep 17 00:00:00 2001 From: lanrtop Date: Thu, 2 Apr 2026 09:23:29 +0900 Subject: [PATCH] fix: use .exe.sig for tauri v2 updater format --- .github/workflows/release.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 191a81a..ee66658 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -88,12 +88,11 @@ jobs: Get-ChildItem "$env:GITHUB_WORKSPACE\src-tauri\target\release\bundle" -Recurse | ForEach-Object { Write-Host $_.FullName } $all = Get-ChildItem $nsisDir + # Tauri v2: 更新包是 .exe + .exe.sig(不再是 .nsis.zip) $installer = $all | Where-Object { $_.Name.EndsWith('-setup.exe') } | Select-Object -First 1 - $updateZip = $all | Where-Object { $_.Name.EndsWith('.nsis.zip') -and -not $_.Name.EndsWith('.nsis.zip.sig') } | Select-Object -First 1 - $sigFile = $all | Where-Object { $_.Name.EndsWith('.nsis.zip.sig') } | Select-Object -First 1 + $sigFile = $all | Where-Object { $_.Name.EndsWith('-setup.exe.sig') } | Select-Object -First 1 Write-Host "installer : $($installer?.FullName)" - Write-Host "updateZip : $($updateZip?.FullName)" Write-Host "sigFile : $($sigFile?.FullName)" if (-not $installer) { Write-Error "installer not found!"; exit 1 } @@ -105,11 +104,10 @@ jobs: & $oss cp $installer.FullName "$bucket/releases/$tag/$($installer.Name)" -f - if ($updateZip -and $sigFile) { - & $oss cp $updateZip.FullName "$bucket/releases/$tag/$($updateZip.Name)" -f - & $oss cp $sigFile.FullName "$bucket/releases/$tag/$($sigFile.Name)" -f + if ($sigFile) { + & $oss cp $sigFile.FullName "$bucket/releases/$tag/$($sigFile.Name)" -f - # 生成 latest.json + # 生成 latest.json(Tauri v2 格式:url 指向 .exe,signature 来自 .exe.sig) $date = (Get-Date -Format 'yyyy-MM-ddTHH:mm:ssZ') $baseUrl = "https://$env:OSS_BUCKET.$env:OSS_ENDPOINT/releases/$tag" $sig = (Get-Content $sigFile.FullName -Raw).Trim() @@ -121,7 +119,7 @@ jobs: platforms = [ordered]@{ 'windows-x86_64' = [ordered]@{ signature = $sig - url = "$baseUrl/$($updateZip.Name)" + url = "$baseUrl/$($installer.Name)" } } } | ConvertTo-Json -Depth 5 @@ -133,6 +131,5 @@ jobs: & $oss cp latest.json "$bucket/latest.json" -f Write-Host "latest.json uploaded" } else { - Write-Warning "update bundle (.nsis.zip) not found — skipping updater upload" - Write-Warning "Check that TAURI_SIGNING_PRIVATE_KEY is correctly set" + Write-Warning "sigFile (.exe.sig) not found — skipping updater upload" }