feature add sentry cli function for mac os

This commit is contained in:
alves
2025-12-11 09:35:19 +08:00
parent d76a460917
commit c5e8bd2b1e
3 changed files with 56 additions and 1 deletions

View File

@@ -159,5 +159,6 @@ jobs:
with:
os: ${{ inputs.os }}
pdb-artifact-name: PDB
release: ${{ github.sha }}
dsym-artifact-name: ${{ inputs.os == 'macos-14' && format('dSYM_Mac_{0}', needs.build_orca.outputs.release) || '' }}
release: ${{ needs.build_orca.outputs.release || github.sha }}
secrets: inherit

View File

@@ -204,6 +204,14 @@ jobs:
path: ${{ github.workspace }}/Snapmaker_Orca_profile_validator_Mac_universal_${{ env.ver }}.dmg
if-no-files-found: ignore
- name: Upload dSYM artifacts mac
if: inputs.os == 'macos-14'
uses: actions/upload-artifact@v4
with:
name: dSYM_Mac_${{ env.ver }}
path: ${{ github.workspace }}/build/universal/Snapmaker_Orca/dSYM
if-no-files-found: ignore
- name: Deploy Mac release
if: (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/2.2.0') && inputs.os == 'macos-14'
uses: WebFreak001/deploy-nightly@v3.2.0

View File

@@ -11,6 +11,10 @@ on:
required: false
type: string
description: "Artifact name for Windows PDB archive (e.g., 'PDB')"
dsym-artifact-name:
required: false
type: string
description: "Artifact name for macOS dSYM archive (e.g., 'dSYM_Mac_V1.0.0')"
release:
required: true
type: string
@@ -86,7 +90,49 @@ jobs:
}
# ==================== macOS ====================
- name: "[macOS] Install sentry-cli via brew"
if: inputs.os == 'macos-14'
run: |
brew install getsentry/tap/sentry-cli || true
sentry-cli --version
- name: "[macOS] Download dSYM artifact"
if: inputs.os == 'macos-14'
uses: actions/download-artifact@v4
with:
name: ${{ inputs.dsym-artifact-name }}
path: ./symbols
- name: "[macOS] Upload dSYM to Sentry (sentry-cli)"
if: inputs.os == 'macos-14'
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_LOG_LEVEL: debug
run: |
echo "Checking for dSYM files in ./symbols..."
find ./symbols -name "*.dSYM" -type d | while read dsym; do
echo "Found dSYM: $dsym"
done
dsymCount=$(find ./symbols -name "*.dSYM" -type d | wc -l | tr -d ' ')
if [ "$dsymCount" -gt 0 ]; then
echo "Found $dsymCount dSYM file(s) to upload from ./symbols:"
find ./symbols -name "*.dSYM" -type d | while read dsym; do
echo " - $dsym"
done
echo ""
echo "Starting Sentry upload with debug logging..."
sentry-cli --log-level=debug --auth-token "$SENTRY_AUTH_TOKEN" upload-dif --org "${{ secrets.SENTRY_ORG }}" --project "${{ secrets.SENTRY_PROJECT }}" --release "${{ inputs.release }}" ./symbols
if [ $? -ne 0 ]; then
echo "::error::Sentry upload failed with exit code $?"
exit 1
fi
else
echo "::error::No dSYM files found in ./symbols"
echo "Contents of ./symbols:"
find ./symbols -type f -o -type d | head -20
exit 1
fi
# ==================== Linux ====================