@@ -181,41 +181,19 @@ jobs:
181181 if : matrix.platform == 'windows'
182182 shell : pwsh
183183 run : |
184- $pfxPath = Join-Path (Get-Location) "certificate.pfx"
185-
186- $certBytes = [Convert]::FromBase64String("${{ secrets.WINDOWS_PFX }}")
187- [IO.File]::WriteAllBytes($pfxPath, $certBytes)
188-
189- echo "WINDOWS_PFX_PATH=$pfxPath" >> $env:GITHUB_ENV
190- echo "WINDOWS_PFX_PASSWORD=${{ secrets.WINDOWS_PFX_PASSWORD }}" >> $env:GITHUB_ENV
191-
192- - name : Add signtool to PATH (Windows)
193- if : matrix.platform == 'windows'
194- shell : pwsh
195- run : |
196- # Find signtool.exe in Windows SDK
197- $sdkPath = "C:\Program Files (x86)\Windows Kits\10\bin"
198- $signtoolPath = Get-ChildItem -Path $sdkPath -Recurse -Filter "signtool.exe" -ErrorAction SilentlyContinue |
199- Where-Object { $_.FullName -match "x64" } |
200- Sort-Object { [version]($_.Directory.Parent.Name -replace '\.0$', '') } -Descending |
201- Select-Object -First 1
202-
203- if ($signtoolPath) {
204- $signtoolDir = $signtoolPath.DirectoryName
205- echo "Found signtool at: $signtoolDir"
206- echo "$signtoolDir" >> $env:GITHUB_PATH
207- } else {
208- Write-Error "signtool.exe not found in Windows SDK"
209- exit 1
210- }
184+ $certDir = "certificate"
185+ New-Item -ItemType Directory -Force -Path $certDir | Out-Null
186+ $pfxPath = Join-Path $certDir "certificate.pfx"
187+ $certBytes = [Convert]::FromBase64String("${{ secrets.WINDOWS_PFX }}")
188+ [IO.File]::WriteAllBytes($pfxPath, $certBytes)
189+ $password = ConvertTo-SecureString "${{ secrets.WINDOWS_PFX_PASSWORD }}" -AsPlainText -Force
190+ Import-PfxCertificate -FilePath $pfxPath -CertStoreLocation Cert:\CurrentUser\My -Password $password | Out-Null
211191
212192 - name : Build the app
213193 if : matrix.platform == 'windows'
214194 uses : tauri-apps/tauri-action@v0
215195 env :
216196 NODE_OPTIONS : " --max_old_space_size=4096"
217- WINDOWS_PFX_PATH : ${{ env.WINDOWS_PFX_PATH }}
218- WINDOWS_PFX_PASSWORD : ${{ env.WINDOWS_PFX_PASSWORD }}
219197 TAURI_SIGNING_PRIVATE_KEY : ${{ secrets.TAURI_PRIVATE_KEY }}
220198 TAURI_SIGNING_PRIVATE_KEY_PASSWORD : ${{ secrets.TAURI_KEY_PASSWORD }}
221199 with :
0 commit comments