From 6e134a8ad98df53cd02685243b48969366499ecb Mon Sep 17 00:00:00 2001 From: John Kleinschmidt Date: Mon, 8 Dec 2025 16:03:40 -0500 Subject: [PATCH] build: use powershell for Electron build step (#49144) --- .github/actions/build-electron/action.yml | 34 +++++++++++++++++++---- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/.github/actions/build-electron/action.yml b/.github/actions/build-electron/action.yml index 36f5d2c27c..26e79025f4 100644 --- a/.github/actions/build-electron/action.yml +++ b/.github/actions/build-electron/action.yml @@ -45,6 +45,7 @@ runs: shell: bash run: echo "::add-matcher::src/electron/.github/problem-matchers/clang.json" - name: Build Electron ${{ inputs.step-suffix }} + if: ${{ inputs.target-platform != 'win' }} shell: bash run: | rm -rf "src/out/Default/Electron Framework.framework" @@ -70,14 +71,37 @@ runs: # Upload build stats to Datadog if ! [ -z $DD_API_KEY ]; then - if [ "$TARGET_PLATFORM" = "win" ]; then - npx node electron/script/build-stats.mjs out/Default/siso.exe.INFO --upload-stats || true - else - npx node electron/script/build-stats.mjs out/Default/siso.INFO --upload-stats || true - fi + npx node electron/script/build-stats.mjs out/Default/siso.INFO --upload-stats || true else echo "Skipping build-stats.mjs upload because DD_API_KEY is not set" fi + - name: Build Electron (Windows) ${{ inputs.step-suffix }} + if: ${{ inputs.target-platform == 'win' }} + shell: powershell + run: | + cd src\electron + git pack-refs + cd .. + + $env:NINJA_SUMMARIZE_BUILD = 1 + if ("${{ inputs.is-release }}" -eq "true") { + e build --target electron:release_build + } else { + e build --target electron:testing_build + } + Copy-Item out\Default\.ninja_log out\electron_ninja_log + node electron\script\check-symlinks.js + + # Upload build stats to Datadog + if ($env:DD_API_KEY) { + try { + npx node electron\script\build-stats.mjs out\Default\siso.exe.INFO --upload-stats + } catch { + Write-Host "Build stats upload failed, continuing..." + } + } else { + Write-Host "Skipping build-stats.mjs upload because DD_API_KEY is not set" + } - name: Verify dist.zip ${{ inputs.step-suffix }} shell: bash run: |