Repository navigation
[No QA] Move sentry size analysis upload to deploy step #94039
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
Changes from all commits
f5808d4
f8edaa8
2ab2350
bc46a6b
9b0d8e9
c102de1
0a43d19
9085b3a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| name: Upload build to Sentry for size analysis | ||
| description: | | ||
| Download a platform binary and upload it to Sentry for size analysis. The binary is sourced | ||
| from either the current workflow run's artifacts (cherry-pick prod deploys, which build natively) | ||
| or the matching staging GitHub Release (re-promotion prod deploys, which do not build natively). | ||
|
|
||
| inputs: | ||
| platform: | ||
| description: "Platform label used in the GH Actions notice (e.g. 'Android' or 'iOS')" | ||
| required: true | ||
| asset-name: | ||
| description: "Filename of the binary on disk and as the GH Release asset (e.g. 'Expensify-release.aab')" | ||
| required: true | ||
| artifact-name: | ||
| description: "Name of the GH Actions artifact to download for cherry-pick deploys (e.g. 'androidBuild-artifact')" | ||
| required: true | ||
| staging-release-tag: | ||
| description: "Tag of the staging GH Release to download from for re-promotion deploys (e.g. '9.4.13-0-staging')" | ||
| required: true | ||
| is-cherry-pick: | ||
| description: "'true' when this deploy is a cherry-pick (binary is in the current run); 'false' otherwise (binary is on the staging release)" | ||
| required: true | ||
|
|
||
| outputs: | ||
| SENTRY_URL: | ||
| description: URL to the Sentry size analysis for the uploaded build (empty if upload failed or quota exhausted) | ||
| value: ${{ steps.upload.outputs.SENTRY_URL }} | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Setup Node | ||
| uses: ./.github/actions/composite/setupNode | ||
|
|
||
| - name: Download binary from current workflow run (cherry-pick path) | ||
| if: ${{ inputs.is-cherry-pick == 'true' }} | ||
| continue-on-error: true | ||
| # v7 | ||
| uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 | ||
| with: | ||
| name: ${{ inputs.artifact-name }} | ||
| path: ./ | ||
|
|
||
| - name: Download binary from the staging GitHub Release (re-promotion path) | ||
| if: ${{ inputs.is-cherry-pick != 'true' }} | ||
| continue-on-error: true | ||
| shell: bash | ||
| env: | ||
| TAG: ${{ inputs.staging-release-tag }} | ||
| ASSET: ${{ inputs.asset-name }} | ||
| run: | | ||
| gh release download "$TAG" --pattern "$ASSET" --output "$ASSET" | ||
| [ -s "$ASSET" ] || { echo "::error::Failed to obtain $ASSET from $TAG"; exit 1; } | ||
|
|
||
| - name: Upload to Sentry | ||
| id: upload | ||
| if: ${{ hashFiles(inputs.asset-name) != '' }} | ||
| continue-on-error: true | ||
|
Comment on lines
+55
to
+58
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
In production deploys where Useful? React with 👍 / 👎. |
||
| shell: bash | ||
| env: | ||
| ASSET: ${{ inputs.asset-name }} | ||
| PLATFORM: ${{ inputs.platform }} | ||
| run: | | ||
| OUTPUT=$(npx sentry-cli build upload "$ASSET" \ | ||
| --org expensify --project app --build-configuration Release --log-level info 2>&1) | ||
| echo "$OUTPUT" | ||
| SENTRY_URL=$(echo "$OUTPUT" | grep -oE 'https://expensify\.sentry\.io/[^ )"}]+' | head -1) | ||
| if [ -n "$SENTRY_URL" ]; then | ||
| echo "::notice::${PLATFORM} Sentry size analysis: $SENTRY_URL" | ||
| echo "SENTRY_URL=$SENTRY_URL" >> "$GITHUB_OUTPUT" | ||
| fi | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NAB
${{ }}isn't necessary onif