native macOS codings agent orchestrator
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #210 from onevcat/feature/release-sentry-dsym

Upload dSYMs and register Sentry release during publish

authored by

Wei Wang and committed by
GitHub
6cc3cb54 4b62bdde

+99
+52
doc-onevcat/fork-sync-and-release.md
··· 95 95 | `APPLE_TEAM_ID` | from identity | Apple Team ID | 96 96 | `APPLE_NOTARY_KEYCHAIN_PROFILE` | `supacode-notary` | Keychain profile for notarytool | 97 97 | `SPARKLE_PRIVATE_KEY_FILE` | `~/.prowl-sparkle-private-key` | EdDSA private key for appcast | 98 + | `SKIP_SENTRY` | unset | Set to `1` to skip dSYM upload and Sentry release tracking | 98 99 99 100 ## Notarization Credentials 100 101 ··· 105 106 --apple-id <email> \ 106 107 --password <app-specific-password> \ 107 108 --team-id <team-id> 109 + ``` 110 + 111 + ## Sentry Integration 112 + 113 + The release script uploads dSYMs and registers each version as a Sentry release so crash reports get symbolicated stack traces and dashboards can associate issues with specific versions. 114 + 115 + ### One-time setup 116 + 117 + Install `sentry-cli` (separate from the newer `sentry` CLI used for issue inspection): 118 + 119 + ```bash 120 + brew install getsentry/tools/sentry-cli 121 + ``` 122 + 123 + Configure auth + defaults in `~/.sentryclirc`: 124 + 125 + ```ini 126 + [auth] 127 + token=sntryu_xxxxxxxx 128 + 129 + [defaults] 130 + url=https://sentry.io/ 131 + org=onevs-den 132 + project=prowl-macos 133 + ``` 134 + 135 + Token scopes required: `event:read`, `project:read`, `project:releases`. Generate at <https://sentry.io/settings/account/api/auth-tokens/>. 136 + 137 + ### What the release script does 138 + 139 + After `make archive` produces `build/supacode.xcarchive/dSYMs/`: 140 + 141 + 1. `sentry-cli releases new prowl@<VERSION>` — registers the release 142 + 2. `sentry-cli debug-files upload --include-sources --wait <dSYM>` — uploads symbols + source context 143 + 3. `sentry-cli releases set-commits --auto` — associates commits for "first seen in" tracking 144 + 4. After GitHub Release is published: `sentry-cli releases finalize prowl@<VERSION>` 145 + 146 + The release name `prowl@<VERSION>` matches `options.releaseName` set in `supacode/App/supacodeApp.swift`, so dSYMs and issues align automatically. 147 + 148 + ### Failure handling 149 + 150 + Any Sentry step that fails only prints a warning — the release continues. dSYMs can be re-uploaded later with: 151 + 152 + ```bash 153 + sentry-cli debug-files upload --include-sources <path-to-dSYM> 154 + ``` 155 + 156 + To skip the entire Sentry block (e.g. emergency release, sentry-cli not installed): 157 + 158 + ```bash 159 + SKIP_SENTRY=1 ./doc-onevcat/scripts/release.sh 108 160 ``` 109 161 110 162 ## Helper Scripts
+47
doc-onevcat/scripts/release.sh
··· 13 13 # APPLE_NOTARY_KEYCHAIN_PROFILE Keychain profile for notarytool (default: supacode-notary) 14 14 # SPARKLE_PRIVATE_KEY_FILE Path to EdDSA private key file (default: ~/.prowl-sparkle-private-key) 15 15 # NETLIFY_BUILD_HOOK Netlify Build Hook URL for Prowl-Site rebuild 16 + # SKIP_SENTRY Set to 1 to skip dSYM upload and Sentry release tracking 16 17 set -euo pipefail 17 18 18 19 SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" ··· 67 68 command -v "$cmd" >/dev/null 2>&1 || die "$cmd is required but not found" 68 69 done 69 70 [[ -x "$PROJECT_DIR/bins/generate_appcast" ]] || die "bins/generate_appcast not found" 71 + 72 + SENTRY_ENABLED=1 73 + if [[ "${SKIP_SENTRY:-}" == "1" ]]; then 74 + SENTRY_ENABLED=0 75 + log "SKIP_SENTRY=1 set, dSYM upload and release tracking will be skipped" 76 + elif ! command -v sentry-cli >/dev/null 2>&1; then 77 + SENTRY_ENABLED=0 78 + log "WARNING: sentry-cli not installed; dSYM upload will be skipped" 79 + log " install: brew install getsentry/tools/sentry-cli" 80 + log " suppress: SKIP_SENTRY=1" 81 + fi 70 82 71 83 if [[ -n "$(git status --porcelain)" ]]; then 72 84 die "working tree is not clean — commit or stash changes first" ··· 181 193 log "archiving Release build..." 182 194 make archive APPLE_TEAM_ID="$TEAM_ID" DEVELOPER_ID_IDENTITY_SHA="$IDENTITY_SHA" 183 195 196 + # ── Sentry: register release + upload dSYM ────────────────────────────────── 197 + # Done right after archive so dSYM is ready before downstream steps. Failures 198 + # only warn — release proceeds because dSYM can be re-uploaded later with 199 + # `sentry-cli debug-files upload <dSYM>`. 200 + 201 + SENTRY_RELEASE_NAME="prowl@$VERSION" 202 + if [[ "$SENTRY_ENABLED" -eq 1 ]]; then 203 + log "creating Sentry release $SENTRY_RELEASE_NAME..." 204 + sentry-cli releases new "$SENTRY_RELEASE_NAME" \ 205 + || log "WARNING: failed to create Sentry release (continuing)" 206 + 207 + DSYM_DIR="build/supacode.xcarchive/dSYMs" 208 + if [[ -d "$DSYM_DIR" ]]; then 209 + log "uploading dSYM from $DSYM_DIR to Sentry..." 210 + sentry-cli debug-files upload --include-sources --wait "$DSYM_DIR" \ 211 + || log "WARNING: dSYM upload failed (release will continue; re-run sentry-cli debug-files upload later)" 212 + else 213 + log "WARNING: $DSYM_DIR not found, skipping dSYM upload" 214 + fi 215 + 216 + log "associating commits with Sentry release..." 217 + sentry-cli releases set-commits "$SENTRY_RELEASE_NAME" --auto \ 218 + || log "WARNING: failed to associate commits (continuing)" 219 + fi 220 + 184 221 # ── Export ─────────────────────────────────────────────────────────────────── 185 222 186 223 log "generating ExportOptions.plist..." ··· 334 371 335 372 RELEASE_URL="https://github.com/$REPO/releases/tag/$TAG" 336 373 log "release created: $RELEASE_URL" 374 + 375 + # ── Finalize Sentry release ───────────────────────────────────────────────── 376 + # Marks the release as deployed in Sentry's dashboard so issue tracking can 377 + # associate "first seen in" with this version. 378 + 379 + if [[ "$SENTRY_ENABLED" -eq 1 ]]; then 380 + log "finalizing Sentry release $SENTRY_RELEASE_NAME..." 381 + sentry-cli releases finalize "$SENTRY_RELEASE_NAME" \ 382 + || log "WARNING: failed to finalize Sentry release (non-fatal)" 383 + fi 337 384 338 385 # ── Trigger Prowl-Site rebuild ─────────────────────────────────────────────── 339 386