Skip to content

Commit 9368ee0

Browse files
authored
fix: resolve absolute paths in Windows signCommand for Tauri bundler (#44)
1 parent 6adcfa3 commit 9368ee0

1 file changed

Lines changed: 18 additions & 13 deletions

File tree

.github/workflows/release.yml

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -86,21 +86,26 @@ jobs:
8686

8787
- name: Configure Tauri Windows signCommand
8888
if: matrix.platform == 'windows-latest' && env.JSIGN_PATH != ''
89-
shell: bash
89+
shell: pwsh
9090
run: |
91-
cat > signing.conf.json << 'EOF'
92-
{
93-
"bundle": {
94-
"windows": {
95-
"signCommand": {
96-
"cmd": "pwsh",
97-
"args": ["-File", "scripts/sign-windows.ps1", "%1"]
98-
}
91+
# Resolve absolute paths — Tauri's bundler uses std::process::Command
92+
# (no shell) so bare names like 'pwsh' fail PATH lookup on Windows.
93+
$pwshPath = (Get-Command pwsh).Source -replace '\\', '/'
94+
$scriptPath = (Resolve-Path "scripts/sign-windows.ps1").Path -replace '\\', '/'
95+
$config = @{
96+
bundle = @{
97+
windows = @{
98+
signCommand = @{
99+
cmd = $pwshPath
100+
args = @("-File", $scriptPath, "%1")
101+
}
102+
}
99103
}
100-
}
101-
}
102-
EOF
103-
echo "SIGNING_ARGS=--config signing.conf.json" >> "$GITHUB_ENV"
104+
} | ConvertTo-Json -Depth 10
105+
$config | Set-Content signing.conf.json
106+
Write-Host "signing.conf.json:"
107+
Get-Content signing.conf.json
108+
Add-Content -Path $env:GITHUB_ENV -Value "SIGNING_ARGS=--config signing.conf.json"
104109
105110
- uses: tauri-apps/tauri-action@v0
106111
env:

0 commit comments

Comments
 (0)