feature add sentry for soft catch dmp

This commit is contained in:
alves
2025-12-03 09:27:09 +08:00
parent b28f1f2de4
commit 9cb538956d
12 changed files with 377 additions and 148 deletions

View File

@@ -150,3 +150,14 @@ jobs:
os: ${{ inputs.os }}
arch: ${{ inputs.arch }}
secrets: inherit
upload_symbols:
name: Upload Debug Symbols to Sentry
needs: [build_orca]
if: ${{ !cancelled() && needs.build_orca.result == 'success' }}
uses: ./.github/workflows/sentry_cli.yml
with:
os: ${{ inputs.os }}
pdb-artifact-name: PDB
release: ${{ github.sha }}
secrets: inherit

View File

@@ -18,6 +18,8 @@ jobs:
build_orca:
name: Build Snapmaker_Orca
runs-on: ${{ inputs.os }}
outputs:
release: ${{ steps.set_release.outputs.release || steps.set_release_win.outputs.release }}
env:
date:
ver:
@@ -77,6 +79,21 @@ jobs:
echo "date: ${{ env.date }} version: ${{ env.ver }}"
shell: pwsh
- name: Set release output (non-Windows)
id: set_release
if: inputs.os != 'windows-latest'
run: |
echo "release=$ver" >> $GITHUB_OUTPUT
shell: bash
- name: Set release output (Windows)
id: set_release_win
if: inputs.os == 'windows-latest'
run: |
$release = $env:ver
Write-Output ("release=$release") | Out-File -Append -FilePath $env:GITHUB_OUTPUT -Encoding utf8
shell: pwsh
# Mac
- name: Install tools mac
if: inputs.os == 'macos-14'

57
.github/workflows/sentry_cli.yml vendored Normal file
View File

@@ -0,0 +1,57 @@
name: Upload Debug Symbols to Sentry
on:
workflow_call:
inputs:
os:
required: true
type: string
description: "Target OS: windows-latest, macos-14, ubuntu-20.04, ubuntu-24.04"
pdb-artifact-name:
required: false
type: string
description: "Artifact name for Windows PDB archive (e.g., 'PDB')"
release:
required: true
type: string
description: "Release version/tag"
jobs:
upload_symbols:
name: Upload Debug Symbols to Sentry
runs-on: ${{ inputs.os }}
steps:
# ==================== Windows ====================
- name: "[Windows] Install sentry-cli via choco"
if: inputs.os == 'windows-latest'
shell: pwsh
run: |
choco install sentry-cli -y -y 2>&1 | Out-Null
- name: "[Windows] Download PDB artifact"
if: inputs.os == 'windows-latest'
uses: actions/download-artifact@v4
with:
name: ${{ inputs.pdb-artifact-name }}
path: ./symbols
- name: "[Windows] Upload PDB to Sentry (sentry-cli)"
if: inputs.os == 'windows-latest'
shell: pwsh
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: |
$pdbArchive = Get-ChildItem -Path ./symbols -Filter "*.7z" -File | Select-Object -First 1
if ($pdbArchive) {
Write-Host "Uploading PDB archive: $($pdbArchive.FullName)"
sentry-cli.exe --auth-token $env:SENTRY_AUTH_TOKEN upload-dif --org "${{ secrets.SENTRY_ORG }}" --project "${{ secrets.SENTRY_PROJECT }}" "$($pdbArchive.FullName)" 2>&1 | Out-Host
} else {
Write-Host "No PDB archive found in symbols folder"
exit 1
}
# ==================== macOS ====================
# ==================== Linux ====================