From 912706b23a785025ad92e96280480a6a2737155c Mon Sep 17 00:00:00 2001 From: Keeley Hammond Date: Wed, 26 Jun 2024 17:41:36 -0700 Subject: [PATCH] build: strip linux release binaries (#42675) --- .github/actions/build-electron/action.yml | 16 ++++++++++++++++ .github/workflows/linux-publish.yml | 3 +++ .../pipeline-segment-electron-build.yml | 6 ++++++ 3 files changed, 25 insertions(+) diff --git a/.github/actions/build-electron/action.yml b/.github/actions/build-electron/action.yml index f8b0807210c..2243d2a2f38 100644 --- a/.github/actions/build-electron/action.yml +++ b/.github/actions/build-electron/action.yml @@ -17,6 +17,9 @@ inputs: is-release: description: 'Is release build' required: true + strip-binaries: + description: 'Strip binaries (Linux only)' + required: false generate-symbols: description: 'Generate symbols' required: true @@ -54,6 +57,19 @@ runs: NINJA_SUMMARIZE_BUILD=1 e build -j $NUMBER_OF_NINJA_PROCESSES cp out/Default/.ninja_log out/electron_ninja_log node electron/script/check-symlinks.js + - name: Strip Electron Binaries ${{ inputs.step-suffix }} + shell: bash + if: ${{ inputs.strip-binaries == 'true' && inputs.target-platform == 'linux' }} + run: | + if [ x"$TARGET_ARCH" == x ]; then + target_cpu=x64 + else + target_cpu="$TARGET_ARCH" + fi + cd src + electron/script/copy-debug-symbols.py --target-cpu="$target_cpu" --out-dir=out/Default/debug --compress + electron/script/strip-binaries.py --target-cpu="$target_cpu" + electron/script/add-debug-link.py --target-cpu="$target_cpu" --debug-dir=out/Default/debug - name: Build Electron dist.zip ${{ inputs.step-suffix }} shell: bash run: | diff --git a/.github/workflows/linux-publish.yml b/.github/workflows/linux-publish.yml index 5ea231532ff..7fb3db2ec73 100644 --- a/.github/workflows/linux-publish.yml +++ b/.github/workflows/linux-publish.yml @@ -49,6 +49,7 @@ jobs: is-release: true gn-build-type: release generate-symbols: true + strip-binaries: true upload-to-storage: ${{ inputs.upload-to-storage }} secrets: inherit @@ -64,6 +65,7 @@ jobs: is-release: true gn-build-type: release generate-symbols: true + strip-binaries: true upload-to-storage: ${{ inputs.upload-to-storage }} secrets: inherit @@ -79,5 +81,6 @@ jobs: is-release: true gn-build-type: release generate-symbols: true + strip-binaries: true upload-to-storage: ${{ inputs.upload-to-storage }} secrets: inherit diff --git a/.github/workflows/pipeline-segment-electron-build.yml b/.github/workflows/pipeline-segment-electron-build.yml index 11b85ec1f6b..a92366623b7 100644 --- a/.github/workflows/pipeline-segment-electron-build.yml +++ b/.github/workflows/pipeline-segment-electron-build.yml @@ -44,6 +44,11 @@ on: required: true type: string default: '0' + strip-binaries: + description: 'Strip the binaries before release (Linux only)' + required: false + type: boolean + default: false is-asan: description: 'Building the Address Sanitizer (ASan) Linux build' required: false @@ -186,6 +191,7 @@ jobs: artifact-platform: ${{ inputs.target-platform == 'linux' && 'linux' || 'darwin' }} is-release: '${{ inputs.is-release }}' generate-symbols: '${{ inputs.generate-symbols }}' + strip-binaries: '${{ inputs.strip-binaries }}' upload-to-storage: '${{ inputs.upload-to-storage }}' is-asan: '${{ inputs.is-asan }}' - name: Set GN_EXTRA_ARGS for MAS Build