File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -102,7 +102,10 @@ jobs:
102102 } catch {
103103 # If Base64 decoding fails, assume it's the raw text content of the key
104104 Write-Output "Secret is not Base64, assuming raw key content."
105- $env:TAURI_SIGNING_PRIVATE_KEY | Out-File -FilePath "tauri.key" -Encoding utf8 -NoNewline
105+ # Explicitly use UTF-8 NO BOM and Trim whitespace
106+ $keyContent = $env:TAURI_SIGNING_PRIVATE_KEY.Trim()
107+ $encoding = New-Object System.Text.UTF8Encoding $false
108+ [System.IO.File]::WriteAllText("$PWD/tauri.key", $keyContent, $encoding)
106109 Write-Output "Saved raw key content to tauri.key"
107110 }
108111
@@ -129,11 +132,10 @@ jobs:
129132 }
130133 }
131134
132- # Strategy: Pass the FILE PATH to Tauri
133- # This bypasses any environment variable string corruption issues
134- $keyPath = (Resolve-Path "tauri.key").Path
135- $env:TAURI_SIGNING_PRIVATE_KEY = $keyPath
136- Write-Output "Setting TAURI_SIGNING_PRIVATE_KEY to path: $keyPath"
135+ # Strategy: Pass the content to Tauri
136+ # We reload it from the file to ensure we use the clean version we just wrote
137+ $env:TAURI_SIGNING_PRIVATE_KEY = [System.IO.File]::ReadAllText("$PWD/tauri.key")
138+ Write-Output "Setting TAURI_SIGNING_PRIVATE_KEY to clean key content (length: $($env:TAURI_SIGNING_PRIVATE_KEY.Length))"
137139
138140 npm run tauri build
139141
Original file line number Diff line number Diff line change 1+ untrusted comment: test
Original file line number Diff line number Diff line change 1+ untrusted comment: test
You can’t perform that action at this time.
0 commit comments