Skip to content

Commit 7450afc

Browse files
committed
chore: add cert thumbprint
1 parent 3097372 commit 7450afc

2 files changed

Lines changed: 10 additions & 30 deletions

File tree

.github/workflows/build-test.yml

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -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:

src-tauri/tauri.windows.conf.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
"bundle": {
55
"targets": ["nsis"],
66
"windows": {
7-
"signCommand": "cmd /C \"signtool.exe sign /fd sha256 /f \\\"%WINDOWS_PFX_PATH%\\\" /p \\\"%WINDOWS_PFX_PASSWORD%\\\" /tr http://timestamp.digicert.com /td sha256 /v \\\"%1\\\"\"",
7+
"certificateThumbprint": "292e5c9c1b8d207a25596b2b9bda73d82db11959",
8+
"digestAlgorithm": "sha256",
9+
"timestampUrl": "http://timestamp.digicert.com",
810
"webviewInstallMode": {
911
"type": "embedBootstrapper",
1012
"silent": true

0 commit comments

Comments
 (0)