-
-
Notifications
You must be signed in to change notification settings - Fork 284
chore: ci workflow for app size analysis #3368
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
Merged
buenaflor
merged 20 commits into
main
from
cursor/add-ci-workflow-for-app-size-analysis-claude-4.5-opus-high-thinking-5fe5
Mar 26, 2026
+166
−20
Merged
Changes from 15 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
2163298
feat: Add Sentry size analysis GitHub workflow
cursoragent 6c7a921
Update
buenaflor 576a32a
Update
buenaflor 54b9af3
Update
buenaflor c3665a4
Update
buenaflor de8ed4a
Change APK build step to Appbundle in workflow
buenaflor 38c2e27
Rename upload step for Android bundle in workflow
buenaflor c41752e
Update
buenaflor 5183773
Update
buenaflor 6339ddc
Update
buenaflor 7c194a8
fix: address PR review feedback for size analysis workflow
buenaflor 4c9854b
ci: add path filtering to size analysis workflow
buenaflor 5432a8c
fix: update Android package name in run.sh to match renamed package ID
buenaflor 32c38b5
ci(size-analysis): Use fastlane for signed iOS builds and Sentry upload
buenaflor 474a041
fix(size-analysis): Pass explicit IPA path to sentry_upload_build
buenaflor f9d5bfd
Revert "fix(size-analysis): Pass explicit IPA path to sentry_upload_b…
buenaflor 98a35b7
Revert "ci(size-analysis): Use fastlane for signed iOS builds and Sen…
buenaflor 0964799
Update size-analysis.yml to exclude flutter.properties
buenaflor 2e5d352
ci(size-analysis): Add obfuscation, use macos-latest, and clean up setup
buenaflor e652d38
fix: Update JNI function names to match renamed package ID
buenaflor 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,49 @@ | ||
| name: Size Analysis Setup | ||
| description: Common setup steps for size analysis builds (Flutter, Sentry CLI, version parsing) | ||
|
|
||
| runs: | ||
| using: composite | ||
|
|
||
| steps: | ||
| - name: Read configured Flutter SDK version | ||
| id: conf | ||
| shell: bash | ||
| working-directory: packages/flutter/example | ||
| run: | | ||
| version=$(grep "version" ../../../metrics/flutter.properties | cut -d'=' -f2 | xargs) | ||
| echo "flutter=$version" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Install Flutter v${{ steps.conf.outputs.flutter }} | ||
| uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e # pin@v2.21.0 | ||
| with: | ||
| flutter-version: ${{ steps.conf.outputs.flutter }} | ||
|
|
||
| - name: Install Sentry CLI | ||
| if: env.SENTRY_AUTH_TOKEN != '' | ||
| shell: bash | ||
| run: curl -sL https://sentry.io/get-cli/ | SENTRY_CLI_VERSION=2.58.2 sh | ||
buenaflor marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
buenaflor marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - name: Determine build version | ||
denrase marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| shell: bash | ||
| working-directory: packages/flutter/example | ||
| run: | | ||
| version_line=$(grep '^version:' pubspec.yaml | awk '{print $2}') | ||
| # Remove any + suffix first (for pubspec.yaml versions like 1.2.3+4) | ||
| version=${version_line%%+*} | ||
|
|
||
| # Parse version: x.y.z-suffix.n → build_name=x.y.z, build_number=n | ||
| # Supports: x.y.z, x.y.z-alpha.n, x.y.z-beta.n, x.y.z-rc.n, etc. | ||
| # Note: build_name is x.y.z only (plist/Android compatibility) | ||
| if [[ $version =~ ^([0-9]+\.[0-9]+\.[0-9]+)-[a-zA-Z]+\.([0-9]+)$ ]]; then | ||
| build_name="${BASH_REMATCH[1]}" | ||
| build_number="${BASH_REMATCH[2]}" | ||
| elif [[ $version =~ ^([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then | ||
| build_name="${BASH_REMATCH[1]}" | ||
| build_number=1 | ||
| else | ||
| build_name="$version" | ||
| build_number=1 | ||
| fi | ||
|
|
||
| echo "SIZE_VERSION=$build_name" >> "$GITHUB_ENV" | ||
| echo "SIZE_BUILD=$build_number" >> "$GITHUB_ENV" | ||
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,114 @@ | ||
| name: Size Analysis | ||
|
|
||
buenaflor marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - 'packages/**' | ||
| - 'metrics/flutter.properties' | ||
| - '.github/workflows/size-analysis.yml' | ||
| - '.github/actions/size-analysis-setup/**' | ||
| pull_request: | ||
buenaflor marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| paths: | ||
| - 'packages/**' | ||
| - 'metrics/flutter.properties' | ||
| - '.github/workflows/size-analysis.yml' | ||
| - '.github/actions/size-analysis-setup/**' | ||
buenaflor marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
| cancel-in-progress: true | ||
|
|
||
| env: | ||
| SENTRY_ORG: sentry-sdks | ||
| SENTRY_PROJECT: sentry-flutter | ||
| SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | ||
|
|
||
| jobs: | ||
| android: | ||
| name: Android | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
| defaults: | ||
| run: | ||
| working-directory: packages/flutter/example | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5 | ||
| with: | ||
| distribution: 'adopt' | ||
| java-version: '17' | ||
|
|
||
| - uses: ./.github/actions/size-analysis-setup | ||
|
|
||
| - name: Build Android Appbundle | ||
| run: | | ||
| flutter pub get | ||
| flutter build appbundle --release \ | ||
buenaflor marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| --build-name "$SIZE_VERSION" \ | ||
| --build-number "$SIZE_BUILD" | ||
|
|
||
| - name: Upload Android Bundle to Sentry Size Analysis | ||
| if: env.SENTRY_AUTH_TOKEN != '' | ||
| run: | | ||
| sentry-cli build upload \ | ||
| "build/app/outputs/bundle/release/app-release.aab" \ | ||
| --org "${{ env.SENTRY_ORG }}" \ | ||
| --project "${{ env.SENTRY_PROJECT }}" \ | ||
| --build-configuration "Release" | ||
|
|
||
| ios: | ||
| name: iOS | ||
| runs-on: macos-15 | ||
buenaflor marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| timeout-minutes: 45 | ||
| defaults: | ||
| run: | ||
| working-directory: packages/flutter/example | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - uses: ./.github/actions/size-analysis-setup | ||
|
|
||
| # QuickFix for failing iOS 18.0 builds https://github.com/actions/runner-images/issues/12758#issuecomment-3187115656 | ||
| - name: Switch to Xcode 16.4 for iOS 18.5 | ||
buenaflor marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| run: sudo xcode-select --switch /Applications/Xcode_16.4.app | ||
|
|
||
| - name: Build Flutter iOS | ||
| run: | | ||
| flutter pub get | ||
| flutter build ios --release --no-codesign \ | ||
| --build-name "$SIZE_VERSION" \ | ||
| --build-number "$SIZE_BUILD" | ||
|
|
||
| - uses: ruby/setup-ruby@dffb23f65a78bba8db45d387d5ea1bbd6be3ef18 # pin@v1.293.0 | ||
| with: | ||
| ruby-version: '2.7.5' | ||
|
|
||
| - name: Install Fastlane | ||
| working-directory: packages/flutter/example/ios | ||
| run: bundle install | ||
|
|
||
| - name: Build signed IPA | ||
| working-directory: packages/flutter/example/ios | ||
| env: | ||
| APP_STORE_CONNECT_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }} | ||
| APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }} | ||
| APP_STORE_CONNECT_KEY: ${{ secrets.APP_STORE_CONNECT_KEY }} | ||
| FASTLANE_KEYCHAIN_PASSWORD: ${{ secrets.FASTLANE_KEYCHAIN_PASSWORD }} | ||
| MATCH_GIT_PRIVATE_KEY: ${{ secrets.MATCH_GIT_PRIVATE_KEY }} | ||
| MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} | ||
| MATCH_USERNAME: ${{ secrets.MATCH_USERNAME }} | ||
| run: bundle exec fastlane build_release | ||
cursor[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - name: Upload iOS build to Sentry Size Analysis | ||
| if: env.SENTRY_AUTH_TOKEN != '' | ||
| working-directory: packages/flutter/example/ios | ||
| run: bundle exec fastlane upload_size_analysis | ||
cursor[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
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 |
|---|---|---|
| @@ -1 +1 @@ | ||
| -keep class io.sentry.samples.flutter.** { *; } | ||
| -keep class io.sentry.flutter.sample.** { *; } |
2 changes: 1 addition & 1 deletion
2
packages/flutter/example/android/app/src/main/AndroidManifest.xml
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
2 changes: 1 addition & 1 deletion
2
...io/sentry/samples/flutter/MainActivity.kt → .../io/sentry/flutter/sample/MainActivity.kt
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,5 @@ | ||
| # Autogenerated by fastlane | ||
| # | ||
| # Ensure this file is checked in to source control! | ||
|
|
||
| gem 'fastlane-plugin-sentry' |
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
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.