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

@@ -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 ====================