ci(windows): build the agent hook before packaging in installer e2e workflows (#28137)

This commit is contained in:
Neil
2026-10-12 19:04:02 -07:00
committed by GitHub
parent 44fabbda52
commit c56e6718b4
4 changed files with 36 additions and 0 deletions
@@ -0,0 +1,27 @@
name: Prepare the Windows agent hook
description: Compiles native/windows-agent-hook into native/windows-agent-hook/.build/orca-agent-hook.exe, which electron-builder --win refuses to package without.
runs:
using: composite
steps:
- name: Cache the Windows agent hook build
if: runner.os == 'Windows'
uses: actions/cache@v5
with:
path: |
native/windows-agent-hook/.build
native/windows-agent-hook/target
~/.cargo/registry
key: windows-agent-hook-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('native/windows-agent-hook/**', 'config/scripts/build-windows-agent-hook.mjs', 'config/scripts/windows-rust-executable-build.mjs', 'resources/build/icon.ico', 'package.json') }}
# Why explicit: a runner image without cargo would otherwise fail inside electron-builder's verify.
- name: Build the Windows agent hook
if: runner.os == 'Windows'
shell: pwsh
run: |
if (-not (Get-Command cargo -ErrorAction SilentlyContinue)) {
rustup toolchain install stable --profile minimal
rustup default stable
}
node config/scripts/build-windows-agent-hook.mjs
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
@@ -119,6 +119,9 @@ jobs:
- uses: ./.github/actions/install-mobile-dependencies
if: steps.cache-installer.outputs.cache-hit != 'true'
- uses: ./.github/actions/prepare-windows-agent-hook
if: steps.cache-installer.outputs.cache-hit != 'true'
- name: Build Windows installer (unsigned)
if: steps.cache-installer.outputs.cache-hit != 'true'
run: |
@@ -57,6 +57,9 @@ jobs:
- uses: ./.github/actions/install-mobile-dependencies
if: steps.cache-installer.outputs.cache-hit != 'true'
- uses: ./.github/actions/prepare-windows-agent-hook
if: steps.cache-installer.outputs.cache-hit != 'true'
# Before the template exists: packaging verifies a present template for every target.
- name: Build Windows installer (unsigned)
if: steps.cache-installer.outputs.cache-hit != 'true'
@@ -101,6 +101,9 @@ jobs:
- uses: ./.github/actions/install-mobile-dependencies
if: steps.cache-installer.outputs.cache-hit != 'true'
- uses: ./.github/actions/prepare-windows-agent-hook
if: steps.cache-installer.outputs.cache-hit != 'true'
- name: Build Windows installer (unsigned)
if: steps.cache-installer.outputs.cache-hit != 'true'
run: |