Repository navigation
[WIP][No QA] Decouple Sentry uploads from native builds #83268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e699cb7
Decouple Sentry uploads from platform builds
roryabraham 355c48e
Add setupSentryCLI composite action with checksum verification
roryabraham 20f0336
Use descriptive Sentry release names for adhoc builds
roryabraham d4c51ef
Use version tag as Sentry release name for staging/production deploys
roryabraham 32172d8
Merge remote-tracking branch 'origin/main' into rory-decouple-sentry-…
roryabraham 1d04291
Disable Sentry auto-upload in Android build
roryabraham c674fcd
Align Sentry upload release name with runtime SDK
roryabraham 1dbdc3a
Checkout built ref in uploadSentry to match package.json
roryabraham File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| name: Setup Sentry CLI | ||
| description: Download sentry-cli binary from GitHub releases with SHA256 checksum verification | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Download and verify sentry-cli | ||
| shell: bash | ||
| run: | | ||
| # To update: change VERSION and update checksums from | ||
| # https://github.com/getsentry/sentry-cli/releases | ||
| readonly VERSION="3.2.2" | ||
|
|
||
| declare -A CHECKSUMS=( | ||
| ["Linux-x86_64"]="ec5987dc83ce601fb99bbc43abbc5623832ea507c13ee13f9eab62bf77d3e55e" | ||
| ["Linux-aarch64"]="06d6498e48eb7c39dbf848a341689eb16ef646eace29d39fd0e4136c637b36a1" | ||
| ["Darwin-x86_64"]="fed5ac43d7daa7db665ea74aee1c4ba35da63d745243cf32e6c33762230aab7c" | ||
| ["Darwin-arm64"]="5c9fc7f3157d08bc36c9e44d199602e11da5c3135f217068da2d7c3390f0af22" | ||
| ) | ||
|
|
||
| OS=$(uname -s) | ||
| ARCH=$(uname -m) | ||
| EXPECTED_SHA="${CHECKSUMS[${OS}-${ARCH}]}" | ||
|
|
||
| if [[ -z "$EXPECTED_SHA" ]]; then | ||
| echo "::error::Unsupported platform: ${OS}-${ARCH}" | ||
| exit 1 | ||
| fi | ||
|
|
||
| INSTALL_DIR="${RUNNER_TEMP:-/tmp}/sentry-cli" | ||
| mkdir -p "$INSTALL_DIR" | ||
|
|
||
| DOWNLOAD_URL="https://github.com/getsentry/sentry-cli/releases/download/${VERSION}/sentry-cli-${OS}-${ARCH}" | ||
| echo "Downloading sentry-cli ${VERSION} for ${OS}-${ARCH}..." | ||
|
|
||
| curl --fail --location --retry 3 --retry-delay 3 \ | ||
| "$DOWNLOAD_URL" --output "$INSTALL_DIR/sentry-cli" | ||
|
|
||
| ACTUAL_SHA=$(sha256sum "$INSTALL_DIR/sentry-cli" | awk '{print $1}') | ||
| if [[ "$ACTUAL_SHA" != "$EXPECTED_SHA" ]]; then | ||
| echo "::error::Checksum mismatch for sentry-cli ${VERSION} (${OS}-${ARCH}): expected ${EXPECTED_SHA}, got ${ACTUAL_SHA}" | ||
| rm -f "$INSTALL_DIR/sentry-cli" | ||
| exit 1 | ||
| fi | ||
|
|
||
| chmod +x "$INSTALL_DIR/sentry-cli" | ||
| echo "$INSTALL_DIR" >> "$GITHUB_PATH" | ||
| echo "Installed sentry-cli ${VERSION} (SHA256 verified)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,141 @@ | ||
| name: Upload debug symbols to Sentry | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| environment: | ||
| description: "'adhoc', 'staging', or 'production'" | ||
| type: string | ||
| required: true | ||
| ref: | ||
| description: 'Git ref to checkout (must match the ref used to build the artifacts)' | ||
| type: string | ||
| default: '' | ||
| artifact-prefix: | ||
| description: 'The prefix for build artifact names' | ||
| type: string | ||
| default: '' | ||
|
|
||
| jobs: | ||
| uploadSentry: | ||
| name: Upload debug symbols to Sentry | ||
| runs-on: blacksmith-4vcpu-ubuntu-2404 | ||
| continue-on-error: true | ||
| steps: | ||
| - name: Checkout | ||
| # v6 | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | ||
| with: | ||
| ref: ${{ inputs.ref || github.sha }} | ||
| fetch-depth: 0 | ||
|
roryabraham marked this conversation as resolved.
Resolved
|
||
|
|
||
| - name: Determine Sentry release name | ||
| id: release | ||
| run: | | ||
| PKG_NAME=$(jq -r .name < package.json) | ||
| PKG_VERSION=$(jq -r .version < package.json) | ||
| RELEASE="${PKG_NAME}@${PKG_VERSION}" | ||
| echo "RELEASE=$RELEASE" >> "$GITHUB_OUTPUT" | ||
| echo "Sentry release: $RELEASE" | ||
|
|
||
| - name: Download Android sourcemap | ||
| id: download-android-sourcemap | ||
| continue-on-error: true | ||
| # v7 | ||
| uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 | ||
| with: | ||
| name: ${{ inputs.artifact-prefix }}android-sourcemap-artifact | ||
| path: ./sentry-sourcemaps | ||
|
|
||
| - name: Download Android proguard mapping | ||
| id: download-android-proguard | ||
| continue-on-error: true | ||
| # v7 | ||
| uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 | ||
| with: | ||
| name: ${{ inputs.artifact-prefix }}android-proguard-mapping | ||
| path: ./sentry-proguard | ||
|
|
||
| - name: Download iOS sourcemap | ||
| id: download-ios-sourcemap | ||
| continue-on-error: true | ||
| # v7 | ||
| uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 | ||
| with: | ||
| name: ${{ inputs.artifact-prefix }}ios-sourcemap-artifact | ||
| path: ./sentry-sourcemaps | ||
|
|
||
| - name: Download iOS dSYMs | ||
| id: download-ios-dsym | ||
| continue-on-error: true | ||
| # v7 | ||
| uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 | ||
| with: | ||
| name: ${{ inputs.artifact-prefix }}ios-dsym-artifact | ||
| path: ./sentry-dsyms | ||
|
|
||
| - name: Download Web sourcemaps | ||
| id: download-web-sourcemaps | ||
| continue-on-error: true | ||
| # v7 | ||
| uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 | ||
| with: | ||
| name: web-sourcemaps-artifact | ||
| path: ./sentry-sourcemaps | ||
|
|
||
| - name: Create Sentry release and upload sourcemaps | ||
| if: steps.download-android-sourcemap.outcome == 'success' || steps.download-ios-sourcemap.outcome == 'success' || steps.download-web-sourcemaps.outcome == 'success' | ||
| # v3.5.0 | ||
| uses: getsentry/action-release@dab6548b3c03c4717878099e43782cf5be654289 | ||
| env: | ||
| SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | ||
| SENTRY_ORG: expensify | ||
| SENTRY_PROJECT: app | ||
| with: | ||
| environment: ${{ inputs.environment }} | ||
| release: ${{ steps.release.outputs.RELEASE }} | ||
| sourcemaps: ./sentry-sourcemaps | ||
| set_commits: auto | ||
| inject: false | ||
|
|
||
| - name: Setup sentry-cli | ||
| if: steps.download-android-proguard.outcome == 'success' || steps.download-ios-dsym.outcome == 'success' | ||
| uses: ./.github/actions/composite/setupSentryCLI | ||
|
|
||
| - name: Upload proguard mapping to Sentry | ||
| if: steps.download-android-proguard.outcome == 'success' | ||
| env: | ||
| SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | ||
| SENTRY_ORG: expensify | ||
| SENTRY_PROJECT: app | ||
| run: | | ||
| for attempt in 1 2 3; do | ||
| echo "Attempt $attempt: uploading proguard mapping..." | ||
| if sentry-cli upload-proguard ./sentry-proguard/mapping.txt; then | ||
| echo "Proguard mapping uploaded successfully" | ||
| exit 0 | ||
| fi | ||
| echo "::warning::Upload attempt $attempt failed, retrying in 10s..." | ||
| sleep 10 | ||
| done | ||
| echo "::error::Failed to upload proguard mapping after 3 attempts" | ||
| exit 1 | ||
|
|
||
| - name: Upload iOS dSYMs to Sentry | ||
| if: steps.download-ios-dsym.outcome == 'success' | ||
| env: | ||
| SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | ||
| SENTRY_ORG: expensify | ||
| SENTRY_PROJECT: app | ||
| run: | | ||
| for attempt in 1 2 3; do | ||
| echo "Attempt $attempt: uploading iOS dSYMs..." | ||
| if sentry-cli debug-files upload ./sentry-dsyms/; then | ||
| echo "iOS dSYMs uploaded successfully" | ||
| exit 0 | ||
| fi | ||
| echo "::warning::Upload attempt $attempt failed, retrying in 10s..." | ||
| sleep 10 | ||
| done | ||
| echo "::error::Failed to upload iOS dSYMs after 3 attempts" | ||
| exit 1 | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.