Files
OpenBB/desktop/src-tauri/scripts/sign.ps1
Danglewood 039c183c60 [Feature] Open Data Platform Desktop Application (#7238)
* add desktop app code to repository

* fix headers

* bump version

* one more file to bump version in

* cargo fmt

* add permissions to release jobs

* codespell

* Need this folder to exist

* NSNumber apparently

* cargo fmt

* test expectation that didn't get updated

* intel mac runner is macos-15-intel

* empty line at bottom of file..

* apparently didn't save permissions step

* unused windows import

* cargo fmt again

* draft-release workflow

* fix windows test

* try as reusable workflow

* beforeBundleCommand

* relative path

* absolute path...

* the file definitely exists...

* seems that the file was not actually added....

* this file definitely exists

* undo temp edit of draft-release
2025-10-14 15:52:04 +00:00

22 lines
1.1 KiB
PowerShell
Vendored

# Download and set up CodeSignTool
$toolDir = Join-Path $env:GITHUB_WORKSPACE "codesigntool"
New-Item -ItemType Directory -Force -Path $toolDir
$zipPath = Join-Path $toolDir "CodeSignTool.zip"
Invoke-WebRequest -Uri "https://github.com/SSLcom/CodeSignTool/releases/download/v1.3.1/CodeSignTool-v1.3.1-windows.zip" -OutFile $zipPath
Expand-Archive -Path $zipPath -DestinationPath $toolDir -Force
$codeSignToolPath = Join-Path $toolDir "CodeSignTool.bat"
# Find all binaries in the root of the release directory
$targetDir = Join-Path $env:GITHUB_WORKSPACE "target/x86_64-pc-windows-msvc/release"
$filesToSign = Get-ChildItem -Path $targetDir -Include *.exe, *.dll
# Sign each file individually
foreach ($file in $filesToSign) {
Write-Host "Signing $($file.FullName)..."
& $codeSignToolPath sign -username="$($env:ESIGNER_USERNAME)" -password="$($env:ESIGNER_PASSWORD)" -credential_id="$($env:ESIGNER_CREDENTIAL_ID)" -totp_secret="$($env:ESIGNER_TOTP_SECRET)" -file_path="$($file.FullName)" -malware_block="true"
if ($LASTEXITCODE -ne 0) {
Write-Error "Failed to sign $($file.FullName)"
exit 1
}
}