Skip to content

Instantly share code, notes, and snippets.

@nmoinvaz
Last active May 3, 2024 21:34
Show Gist options
  • Save nmoinvaz/3d3f31b2f04371af54cbc77a321398df to your computer and use it in GitHub Desktop.
Save nmoinvaz/3d3f31b2f04371af54cbc77a321398df to your computer and use it in GitHub Desktop.
Upload CEF symbols to Sentry.io
# CEF symbols are too large to upload directly to Sentry.io. The maximum size is 2GB.
# We use Breakpad to reduce the size of the original symbols at the expense of some
# fidelity for inline functions.
name: CEF Symbols
on:
workflow_dispatch:
inputs:
cef-version:
description: 'Version of CEF to upload'
required: true
default: 109.1.18+gf1c41e4+chromium-109.0.5414.120
type: string
sentry-org:
description: 'Sentry organization'
required: true
type: string
sentry-project:
description: 'Sentry project'
required: true
type: string
jobs:
symbols:
name: ${{ matrix.name }}
runs-on: ${{ matrix.runs-on }}
timeout-minutes: 50
strategy:
fail-fast: false
max-parallel: 2
matrix:
include:
- name: Upload to Sentry - Ubuntu (x64)
runs-on: ubuntu-latest
breakpad-utils: lin64
cef-platform: linux64
cef-separate-debug-info: false
- name: Upload to Sentry - macOS (x86)
runs-on: macos-latest
breakpad-utils: mac64
cef-platform: macosx64
cef-separate-debug-info: true
- name: Upload to Sentry - macOS (arm)
runs-on: macos-latest
breakpad-utils: mac64
cef-platform: macosarm64
cef-separate-debug-info: true
- name: Upload to Sentry - Windows (x86)
runs-on: windows-latest
breakpad-utils: win64
cef-platform: windows32
cef-separate-debug-info: true
- name: Upload to Sentry - Windows (x64)
runs-on: windows-latest
breakpad-utils: win64
cef-platform: windows64
cef-separate-debug-info: true
steps:
- name: Checkout
uses: actions/checkout@v4
with:
clean: true
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: brew install p7zip tree
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: sudo apt-get install p7zip-full tree
- name: Install dependencies (Windows)
if: runner.os == 'Windows'
run: choco install 7zip tree
- name: Download breakpad utilities
uses: robinraju/release-downloader@v1.9
with:
repository: snxd/breakpad
latest: true
fileName: breakpad-utilities-${{ matrix.breakpad-utils }}.zip
- name: Unzip breakpad utilties (macOS/Linux)
if: runner.os != 'Windows'
run: |
unzip breakpad-utilities-${{ matrix.breakpad-utils }}.zip -d breakpad
chmod +x breakpad/dump_syms
- name: Unzip Breakpad utilties (Windows)
if: runner.os == 'Windows'
run: 7z e breakpad-utilities-${{ matrix.breakpad-utils }}.zip -obreakpad
- name: Set CEF id environment variable
shell: bash
run: echo "CEF_ID=cef_binary_${{ github.event.inputs.cef-version }}_${{ matrix.cef-platform }}" >> $GITHUB_ENV
- name: Create CEF id directory
shell: bash
run: mkdir ${{ env.CEF_ID }}
- name: Download CEF standard distribution
run: curl -C - -O https://cef-builds.spotifycdn.com/${{ env.CEF_ID }}.tar.bz2
- name: Extract CEF standard distribution
run: |
7z x ${{ env.CEF_ID }}.tar.bz2
7z x ${{ env.CEF_ID }}.tar
- name: Download CEF release symbols
if: ${{ matrix.cef-separate-debug-info }}
run: curl -C - -O https://cef-builds.spotifycdn.com/${{ env.CEF_ID }}_release_symbols.tar.bz2
- name: Extract CEF release symbols
if: ${{ matrix.cef-separate-debug-info }}
shell: bash
run: |
7z x ${{ env.CEF_ID }}_release_symbols.tar.bz2
7z x ${{ env.CEF_ID }}_release_symbols.tar
cd ${{ env.CEF_ID }}_release_symbols
mv * ../${{ env.CEF_ID }}/Release/
- name: Print working tree
shell: bash
run: tree
- name: Run dump_syms (macOS)
if: runner.os == 'macOS'
run: breakpad/dump_syms "${{ env.CEF_ID }}/Release/Chromium Embedded Framework.dSYM" > "${{ env.CEF_ID }}/Release/Chromium Embedded Framework.sym"
- name: Run dump_syms (Linux)
if: runner.os == 'Linux'
run: breakpad/dump_syms ${{ env.CEF_ID }}/Release/libcef.so > ${{ env.CEF_ID }}/Release/libcef.sym
- name: Run dump_syms (Windows)
if: runner.os == 'Windows'
shell: bash
run: breakpad/dump_syms.exe ${{ env.CEF_ID }}/Release/libcef.dll > ${{ env.CEF_ID }}/Release/libcef.dll.sym
- name: Print working tree
shell: bash
run: tree
- name: Setup sentry-cli
uses: mathieu-bour/setup-sentry-cli@v2
with:
token: ${{ secrets.SENTRY_TOKEN }}
organization: ${{ github.events.input.sentry-org }}
- name: Upload CEF debug files
shell: bash
run: |
for path in ${{ env.CEF_ID }}/Release/*.sym; do \
echo "Uploading $path"; \
sentry-cli debug-files upload --org ${{ github.events.input.sentry-org }} --project ${{ github.event.inputs.sentry-project }} "$path"; \
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment