Merge pull request #1309 from ghost/embed-print-fonts

This commit is contained in:
Hakan Seven committed 2026-09-17 06:57:42 +03:00
commit 03f4e7cb86
29 files changed
+1833 -68

No files matched your search

+63 -1
View File
@@ -194,6 +194,11 @@ jobs:
runs-on: windows-latest
permissions:
contents: write
# Step-level `if:` cannot read the `secrets` context, so the signing
# waterfall is driven by these boolean mirrors of the credential secrets.
env:
AZURE_SIGNING_CONFIGURED: ${{ secrets.AZURE_TRUSTED_SIGNING_ACCOUNT_NAME != '' }}
PFX_CONFIGURED: ${{ secrets.WINDOWS_PFX_BASE64 != '' }}
steps:
- name: Checkout
@@ -237,7 +242,11 @@ jobs:
cargo build --locked --release
cargo build --locked --release -p dwg-thumbnailer-win
# Forks do not inherit repository secrets, so every signing step is
# gated on its credentials being present and the pipeline falls through:
# Azure Trusted Signing (upstream setup) -> PFX certificate -> unsigned.
- name: Sign executable (Azure Trusted Signing)
if: env.AZURE_SIGNING_CONFIGURED == 'true'
uses: azure/artifact-signing-action@v2
with:
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
@@ -251,6 +260,37 @@ jobs:
timestamp-rfc3161: http://timestamp.acs.microsoft.com
timestamp-digest: SHA256
- name: Import signing certificate (PFX fallback)
if: env.AZURE_SIGNING_CONFIGURED != 'true' && env.PFX_CONFIGURED == 'true'
shell: pwsh
env:
WINDOWS_PFX_BASE64: ${{ secrets.WINDOWS_PFX_BASE64 }}
run: |
$pfxPath = Join-Path $env:RUNNER_TEMP "signing.pfx"
[IO.File]::WriteAllBytes($pfxPath, [Convert]::FromBase64String($env:WINDOWS_PFX_BASE64))
"Imported signing certificate to $pfxPath"
- name: Sign executable (certificate)
if: env.AZURE_SIGNING_CONFIGURED != 'true' && env.PFX_CONFIGURED == 'true'
shell: pwsh
env:
WINDOWS_PFX_PASSWORD: ${{ secrets.WINDOWS_PFX_PASSWORD }}
run: |
$signtool = Get-ChildItem "C:\Program Files (x86)\Windows Kits\10\bin" -Recurse -Filter signtool.exe |
Where-Object { $_.DirectoryName -match 'x64' } |
Sort-Object FullName -Descending | Select-Object -First 1 -ExpandProperty FullName
if (-not $signtool) { throw "signtool.exe not found in the Windows SDK" }
& $signtool sign /fd SHA256 /tr https://timestamp.digicert.com /td SHA256 `
/f (Join-Path $env:RUNNER_TEMP "signing.pfx") /p $env:WINDOWS_PFX_PASSWORD `
(Resolve-Path target\release\OpenCADStudio.exe).Path
if ($LASTEXITCODE -ne 0) { throw "signtool failed for the executable" }
- name: Note unsigned executable
if: env.AZURE_SIGNING_CONFIGURED != 'true' && env.PFX_CONFIGURED != 'true'
shell: pwsh
run: |
"No signing credentials configured - add the Azure Trusted Signing secrets or WINDOWS_PFX_BASE64/WINDOWS_PFX_PASSWORD to sign. Building UNSIGNED." >> $env:GITHUB_STEP_SUMMARY
- name: Build MSI installer
shell: pwsh
run: |
@@ -283,8 +323,9 @@ jobs:
if ($LASTEXITCODE -ne 0) { throw "light failed" }
- name: Sign MSI installer (Azure Trusted Signing)
# The installer itself must be signed separately — light produces a
# The installer itself must be signed separately - light produces a
# fresh, unsigned .msi even though the .exe inside is already signed.
if: env.AZURE_SIGNING_CONFIGURED == 'true'
uses: azure/artifact-signing-action@v2
with:
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
@@ -298,6 +339,27 @@ jobs:
timestamp-rfc3161: http://timestamp.acs.microsoft.com
timestamp-digest: SHA256
- name: Sign MSI installer (certificate)
if: env.AZURE_SIGNING_CONFIGURED != 'true' && env.PFX_CONFIGURED == 'true'
shell: pwsh
env:
WINDOWS_PFX_PASSWORD: ${{ secrets.WINDOWS_PFX_PASSWORD }}
run: |
$signtool = Get-ChildItem "C:\Program Files (x86)\Windows Kits\10\bin" -Recurse -Filter signtool.exe |
Where-Object { $_.DirectoryName -match 'x64' } |
Sort-Object FullName -Descending | Select-Object -First 1 -ExpandProperty FullName
if (-not $signtool) { throw "signtool.exe not found in the Windows SDK" }
& $signtool sign /fd SHA256 /tr https://timestamp.digicert.com /td SHA256 `
/f (Join-Path $env:RUNNER_TEMP "signing.pfx") /p $env:WINDOWS_PFX_PASSWORD `
(Resolve-Path OpenCADStudio.msi).Path
if ($LASTEXITCODE -ne 0) { throw "signtool failed for the MSI" }
- name: Note unsigned MSI
if: env.AZURE_SIGNING_CONFIGURED != 'true' && env.PFX_CONFIGURED != 'true'
shell: pwsh
run: |
"MSI left unsigned - no signing credentials configured." >> $env:GITHUB_STEP_SUMMARY
- name: Upload artifacts to release
if: env.RELEASE_TAG != ''
shell: pwsh