Unverified 提交 8fb67206 authored 作者: Will Chen's avatar Will Chen 提交者: GitHub

Fix Azure DLL path (#2441)

#skip-bb <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes Azure code signing on Windows by auto-detecting the Azure.CodeSigning.Dlib.dll path and exporting it for the build. Adds better debug output to diagnose signing issues. - **Bug Fixes** - Search Program Files and LocalAppData for x64 Azure.CodeSigning.Dlib.dll and set AZURE_CODE_SIGNING_DLIB in the workflow; fail fast if not found. - Extend DEBUG to include electron-windows-sign. - Log AZURE_CODE_SIGNING_DLIB in forge.config.ts for visibility during builds. <sup>Written for commit 04c1f068a03f8741d3a9c904c1b896f80dfe3a37. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> <!-- devin-review-badge-begin --> --- <a href="https://app.devin.ai/review/dyad-sh/dyad/pull/2441"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1"> <img src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1" alt="Open with Devin"> </picture> </a> <!-- devin-review-badge-end -->
上级 c692cdc9
...@@ -50,6 +50,25 @@ jobs: ...@@ -50,6 +50,25 @@ jobs:
shell: powershell shell: powershell
run: | run: |
winget install -e --id Microsoft.Azure.TrustedSigningClientTools --source winget --accept-source-agreements --accept-package-agreements winget install -e --id Microsoft.Azure.TrustedSigningClientTools --source winget --accept-source-agreements --accept-package-agreements
# Find the DLL path
$dllPath = Get-ChildItem -Path "C:\Program Files" -Recurse -Filter "Azure.CodeSigning.Dlib.dll" -ErrorAction SilentlyContinue |
Where-Object { $_.FullName -like "*x64*" } |
Select-Object -First 1 -ExpandProperty FullName
if (-not $dllPath) {
$dllPath = Get-ChildItem -Path "$env:LOCALAPPDATA" -Recurse -Filter "Azure.CodeSigning.Dlib.dll" -ErrorAction SilentlyContinue |
Where-Object { $_.FullName -like "*x64*" } |
Select-Object -First 1 -ExpandProperty FullName
}
if ($dllPath) {
echo "Found DLL at: $dllPath"
echo "AZURE_CODE_SIGNING_DLIB=$dllPath" >> $env:GITHUB_ENV
} else {
Write-Error "Could not find Azure.CodeSigning.Dlib.dll"
exit 1
}
- name: Create Azure signing metadata - name: Create Azure signing metadata
if: contains(matrix.os.name, 'windows') if: contains(matrix.os.name, 'windows')
shell: powershell shell: powershell
...@@ -94,7 +113,7 @@ jobs: ...@@ -94,7 +113,7 @@ jobs:
max_attempts: 3 max_attempts: 3
command: ./node_modules/.bin/electron-forge publish command: ./node_modules/.bin/electron-forge publish
env: env:
DEBUG: "@electron/*,electron-forge:*,electron-windows-installer:main" DEBUG: "@electron/*,electron-forge:*,electron-windows-installer:main,electron-windows-sign"
NODE_OPTIONS: "--max-old-space-size=4096" NODE_OPTIONS: "--max-old-space-size=4096"
# SM_CODE_SIGNING_CERT_SHA1_HASH: ${{ secrets.SM_CODE_SIGNING_CERT_SHA1_HASH }} # SM_CODE_SIGNING_CERT_SHA1_HASH: ${{ secrets.SM_CODE_SIGNING_CERT_SHA1_HASH }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
...@@ -104,6 +123,7 @@ jobs: ...@@ -104,6 +123,7 @@ jobs:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
SIGNTOOL_PATH: ${{ vars.SIGNTOOL_PATH }}
verify-assets: verify-assets:
name: Verify Release Assets name: Verify Release Assets
......
...@@ -10,6 +10,8 @@ import { FusesPlugin } from "@electron-forge/plugin-fuses"; ...@@ -10,6 +10,8 @@ import { FusesPlugin } from "@electron-forge/plugin-fuses";
import { FuseV1Options, FuseVersion } from "@electron/fuses"; import { FuseV1Options, FuseVersion } from "@electron/fuses";
import { AutoUnpackNativesPlugin } from "@electron-forge/plugin-auto-unpack-natives"; import { AutoUnpackNativesPlugin } from "@electron-forge/plugin-auto-unpack-natives";
console.log("AZURE_CODE_SIGNING_DLIB", process.env.AZURE_CODE_SIGNING_DLIB);
// Based on https://github.com/electron/forge/blob/6b2d547a7216c30fde1e1fddd1118eee5d872945/packages/plugin/vite/src/VitePlugin.ts#L124 // Based on https://github.com/electron/forge/blob/6b2d547a7216c30fde1e1fddd1118eee5d872945/packages/plugin/vite/src/VitePlugin.ts#L124
const ignore = (file: string) => { const ignore = (file: string) => {
if (!file) return false; if (!file) return false;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论