Files
OrcaSlicer/.github/workflows/sentry_cli.yml

93 lines
3.5 KiB
YAML

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] Extract PDB archive"
if: inputs.os == 'windows-latest'
shell: pwsh
run: |
$archive = Get-ChildItem -Path ./symbols -Filter "*.7z" -File | Select-Object -First 1
if ($archive) {
Write-Host "Found archive: $($archive.FullName)"
Write-Host "Extracting to ./symbols/extracted ..."
7z x "$($archive.FullName)" -o"./symbols/extracted" -y
if ($LASTEXITCODE -ne 0) {
Write-Host "::error::Failed to extract archive with exit code $LASTEXITCODE"
exit $LASTEXITCODE
}
Write-Host "Extraction complete. Contents:"
Get-ChildItem -Path ./symbols/extracted -Recurse | ForEach-Object { Write-Host " $($_.FullName)" }
} else {
Write-Host "No .7z archive found, assuming PDB files are already extracted"
Get-ChildItem -Path ./symbols -Recurse | ForEach-Object { Write-Host " Found: $($_.FullName)" }
}
- name: "[Windows] Upload PDB to Sentry (sentry-cli)"
if: inputs.os == 'windows-latest'
shell: pwsh
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_LOG_LEVEL: debug
run: |
# Determine upload path - prefer extracted folder if it exists
$uploadPath = "./symbols"
if (Test-Path "./symbols/extracted") {
$uploadPath = "./symbols/extracted"
}
$pdbFiles = Get-ChildItem -Path $uploadPath -Filter "*.pdb" -File -Recurse
if ($pdbFiles.Count -gt 0) {
Write-Host "Found $($pdbFiles.Count) PDB file(s) to upload from $uploadPath :"
$pdbFiles | ForEach-Object { Write-Host " - $($_.FullName)" }
Write-Host ""
Write-Host "Starting Sentry upload with debug logging..."
sentry-cli.exe --log-level=debug --auth-token $env:SENTRY_AUTH_TOKEN upload-dif --org "${{ secrets.SENTRY_ORG }}" --project "${{ secrets.SENTRY_PROJECT }}" $uploadPath 2>&1 | Out-Host
if ($LASTEXITCODE -ne 0) {
Write-Host "::error::Sentry upload failed with exit code $LASTEXITCODE"
exit $LASTEXITCODE
}
} else {
Write-Host "::error::No PDB files found in $uploadPath"
Get-ChildItem -Path ./symbols -Recurse | ForEach-Object { Write-Host " Found: $($_.FullName)" }
exit 1
}
# ==================== macOS ====================
# ==================== Linux ====================