Skip to content

Commit 62e9428

Browse files
fix(ci): use .cmd wrapper for Windows signtool signing
Tauri signCommand cannot directly execute signtool.exe when its path contains spaces (Program Files). Write a .cmd batch wrapper (matching build.ps1 approach) and invoke it via cmd /C in the structured signCommand format. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0dbdd2c commit 62e9428

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

.github/workflows/release.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,14 +156,16 @@ jobs:
156156
env:
157157
WINDOWS_CERT_PASSWORD: ${{ secrets.WINDOWS_CERT_PASSWORD }}
158158
run: |
159-
# Use structured signCommand to handle spaces in signtool path
160-
$signCmd = @{
161-
cmd = $env:SIGNTOOL_PATH
162-
args = @("sign", "/f", $env:CERT_PATH, "/p", $env:WINDOWS_CERT_PASSWORD, "/t", "http://timestamp.digicert.com", "/fd", "SHA256")
163-
}
159+
# Write a .cmd wrapper so signtool path with spaces is properly quoted
160+
# (.cmd files require cmd.exe to interpret — they can't be launched via CreateProcess)
161+
$signScript = Join-Path "${{ runner.temp }}" 'sign.cmd'
162+
@"
163+
@echo off
164+
"$env:SIGNTOOL_PATH" sign /f "$env:CERT_PATH" /p "$env:WINDOWS_CERT_PASSWORD" /t http://timestamp.digicert.com /fd SHA256 %1
165+
"@ | Out-File -FilePath $signScript -Encoding ascii
164166
$config = @{
165167
build = @{ beforeBuildCommand = "" }
166-
bundle = @{ windows = @{ signCommand = $signCmd } }
168+
bundle = @{ windows = @{ signCommand = @{ cmd = "cmd"; args = @("/C", $signScript, "%1") } } }
167169
} | ConvertTo-Json -Depth 5
168170
$configPath = "${{ runner.temp }}\sign-override.json"
169171
$config | Out-File -FilePath $configPath -Encoding utf8

0 commit comments

Comments
 (0)