Require SENTRY_AUTH_TOKEN for Sentry dSYM upload

Warn and skip upload when SENTRY_AUTH_TOKEN is not set. Invoke
sentry-cli
with --auth-token, --org and --project flags and attempt an upload
including sources, falling back to a plain dSYM upload on failure.

Changelog-None
Closes: #3767

Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
This commit is contained in:
Daniel D’Aquino
2026-05-13 15:30:37 -07:00
parent a8c73bf67c
commit b6127e228e
+6 -4
View File
@@ -25,12 +25,14 @@ if [ ! -d "${DSYM_PATH}" ]; then
exit 0
fi
export SENTRY_ORG=damus-nostr-inc
export SENTRY_PROJECT=apple-ios
if [ -z "${SENTRY_AUTH_TOKEN:-}" ]; then
echo "warning: SENTRY_AUTH_TOKEN is not set, skipping Sentry dSYM upload"
exit 0
fi
if ! error_output=$(sentry-cli debug-files upload --include-sources "${DSYM_PATH}" 2>&1); then
if ! error_output=$(sentry-cli debug-files upload --auth-token "${SENTRY_AUTH_TOKEN}" --org damus-nostr-inc --project apple-ios --include-sources "${DSYM_PATH}" 2>&1); then
echo "warning: sentry-cli failed to upload dSYMs with sources from ${DSYM_PATH}: ${error_output}"
if ! error_output=$(sentry-cli debug-files upload "${DSYM_PATH}" 2>&1); then
if ! error_output=$(sentry-cli debug-files upload --auth-token "${SENTRY_AUTH_TOKEN}" --org damus-nostr-inc --project apple-ios "${DSYM_PATH}" 2>&1); then
echo "warning: sentry-cli failed to upload dSYMs from ${DSYM_PATH}: ${error_output}"
fi
fi