Repository navigation
fix(desktop): codesign ripgrep and node binaries before tauri build #8518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
00215bb
e5f048f
580a4d5
d698e9d
fc8e44c
605bdf5
49a8d86
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -281,16 +281,28 @@ jobs: | |
| env: | ||
| WINDOWS_CERTIFICATE: '${{ secrets.WINDOWS_CERTIFICATE }}' | ||
| WINDOWS_CERTIFICATE_PASSWORD: '${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}' | ||
| LEGACY_WIN_CSC_LINK: '${{ secrets.WIN_CSC_LINK }}' | ||
| LEGACY_WIN_CSC_KEY_PASSWORD: '${{ secrets.WIN_CSC_KEY_PASSWORD }}' | ||
| run: | | ||
| if (-not $env:WINDOWS_CERTIFICATE -or -not $env:WINDOWS_CERTIFICATE_PASSWORD) { | ||
| throw 'WINDOWS_CERTIFICATE and WINDOWS_CERTIFICATE_PASSWORD are required for published Windows releases.' | ||
| # Prefer the Tauri-style WINDOWS_CERTIFICATE pair; fall back to the | ||
| # legacy electron-builder WIN_CSC_LINK pair if only that exists. | ||
| if ($env:WINDOWS_CERTIFICATE -and $env:WINDOWS_CERTIFICATE_PASSWORD) { | ||
| $path = Join-Path $env:RUNNER_TEMP 'qwen-code-desktop.pfx' | ||
| [IO.File]::WriteAllBytes($path, [Convert]::FromBase64String($env:WINDOWS_CERTIFICATE)) | ||
| $password = ConvertTo-SecureString $env:WINDOWS_CERTIFICATE_PASSWORD -AsPlainText -Force | ||
| $certificate = Import-PfxCertificate -FilePath $path -CertStoreLocation Cert:\CurrentUser\My -Password $password | ||
| $windowsConfig = @{ bundle = @{ windows = @{ certificateThumbprint = $certificate.Thumbprint } } } | ConvertTo-Json -Compress -Depth 3 | ||
| "WINDOWS_CONFIG=$windowsConfig" | Out-File -FilePath $env:GITHUB_ENV -Append | ||
| } elseif ($env:LEGACY_WIN_CSC_LINK -and $env:LEGACY_WIN_CSC_KEY_PASSWORD) { | ||
| $path = Join-Path $env:RUNNER_TEMP 'qwen-code-desktop.pfx' | ||
| [IO.File]::WriteAllBytes($path, [Convert]::FromBase64String($env:LEGACY_WIN_CSC_LINK)) | ||
| $password = ConvertTo-SecureString $env:LEGACY_WIN_CSC_KEY_PASSWORD -AsPlainText -Force | ||
| $certificate = Import-PfxCertificate -FilePath $path -CertStoreLocation Cert:\CurrentUser\My -Password $password | ||
| $windowsConfig = @{ bundle = @{ windows = @{ certificateThumbprint = $certificate.Thumbprint } } } | ConvertTo-Json -Compress -Depth 3 | ||
| "WINDOWS_CONFIG=$windowsConfig" | Out-File -FilePath $env:GITHUB_ENV -Append | ||
| } else { | ||
| Write-Output "::warning::Windows signing certificate is not configured. Windows artifacts will be unsigned and may trigger SmartScreen warnings." | ||
| } | ||
| $path = Join-Path $env:RUNNER_TEMP 'qwen-code-desktop.pfx' | ||
| [IO.File]::WriteAllBytes($path, [Convert]::FromBase64String($env:WINDOWS_CERTIFICATE)) | ||
| $password = ConvertTo-SecureString $env:WINDOWS_CERTIFICATE_PASSWORD -AsPlainText -Force | ||
| $certificate = Import-PfxCertificate -FilePath $path -CertStoreLocation Cert:\CurrentUser\My -Password $password | ||
| $windowsConfig = @{ bundle = @{ windows = @{ certificateThumbprint = $certificate.Thumbprint } } } | ConvertTo-Json -Compress -Depth 3 | ||
| "WINDOWS_CONFIG=$windowsConfig" | Out-File -FilePath $env:GITHUB_ENV -Append | ||
|
|
||
| - name: 'Prepare bundled runtime' | ||
| working-directory: 'packages/desktop-shell' | ||
|
|
@@ -308,6 +320,35 @@ jobs: | |
| working-directory: 'packages/desktop-shell' | ||
| run: 'npm run test:release' | ||
|
|
||
| - name: 'Sign bundled vendor binaries (macOS)' | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Major] Signed macOS binaries invalidate the bundled
Suggested fix: regenerate |
||
| if: "runner.os == 'macOS' && inputs.dry_run == false" | ||
| working-directory: 'packages/desktop-shell' | ||
| shell: 'bash' | ||
| env: | ||
| APPLE_SIGNING_IDENTITY: '${{ env.APPLE_SIGNING_IDENTITY }}' | ||
| run: | | ||
| set -euo pipefail | ||
| # Sign all native macOS executables in the bundled runtime so | ||
| # notarization does not reject them. Tauri only signs the main | ||
| # app binary; resources like ripgrep and the Node.js runtime are | ||
| # embedded verbatim and must be signed beforehand. | ||
| runtime_dir="runtime/qwen-code" | ||
| # ripgrep vendor binaries | ||
| rg_dir="$runtime_dir/lib/vendor/ripgrep" | ||
| if [ -d "$rg_dir" ]; then | ||
| find "$rg_dir" -type f -name 'rg' -exec \ | ||
| codesign --force --sign "$APPLE_SIGNING_IDENTITY" \ | ||
| --options runtime --timestamp \ | ||
| --entitlements src-tauri/Entitlements.plist {} \; | ||
| fi | ||
| # Node.js runtime binary | ||
| node_bin="$runtime_dir/node/bin/node" | ||
| if [ -f "$node_bin" ]; then | ||
| codesign --force --sign "$APPLE_SIGNING_IDENTITY" \ | ||
| --options runtime --timestamp \ | ||
| --entitlements src-tauri/Entitlements.plist "$node_bin" | ||
| fi | ||
|
|
||
| - name: 'Build desktop installers' | ||
| working-directory: 'packages/desktop-shell' | ||
| shell: 'bash' | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.