Release to Staging v2.9.28 - 2026-08-07 #3821
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
| name: Mobile Bundle Analysis | |
| permissions: | |
| contents: read | |
| env: | |
| RUBY_VERSION: 3.2 | |
| JAVA_VERSION: 17 | |
| WORKSPACE: ${{ github.workspace }} | |
| APP_PATH: ${{ github.workspace }}/app | |
| NODE_ENV: "production" | |
| on: | |
| push: | |
| branches: | |
| - dev | |
| - staging | |
| - main | |
| paths: | |
| - "app/**" | |
| - "packages/mobile-sdk-alpha/**" | |
| - ".github/workflows/mobile-bundle-analysis.yml" | |
| - ".github/actions/**" | |
| - ".github/CI_FORCE_RUN" | |
| pull_request: | |
| types: [opened, synchronize, reopened, labeled] | |
| branches: | |
| - dev | |
| - staging | |
| - main | |
| paths: | |
| - "app/**" | |
| - "packages/mobile-sdk-alpha/**" | |
| - ".github/workflows/mobile-bundle-analysis.yml" | |
| - ".github/actions/**" | |
| - ".github/CI_FORCE_RUN" | |
| workflow_dispatch: | |
| jobs: | |
| analyze-android: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Read and sanitize Node.js version | |
| shell: bash | |
| run: | | |
| if [ ! -f .nvmrc ] || [ -z "$(cat .nvmrc)" ]; then | |
| echo "❌ .nvmrc is missing or empty"; exit 1; | |
| fi | |
| VERSION="$(tr -d '\r\n' < .nvmrc)" | |
| VERSION="${VERSION#v}" | |
| if ! [[ "$VERSION" =~ ^[0-9]+(\.[0-9]+){0,2}$ ]]; then | |
| echo "Invalid .nvmrc content: '$VERSION'"; exit 1; | |
| fi | |
| echo "NODE_VERSION=$VERSION" >> "$GITHUB_ENV" | |
| echo "NODE_VERSION_SANITIZED=${VERSION//\//-}" >> "$GITHUB_ENV" | |
| - name: Use Node.js | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Cache pnpm store | |
| uses: ./.github/actions/cache-pnpm | |
| with: | |
| cache-version: node-${{ env.NODE_VERSION_SANITIZED }} | |
| - name: Cache Bundler | |
| uses: ./.github/actions/cache-bundler | |
| with: | |
| path: app/vendor/bundle | |
| lock-file: app/Gemfile.lock | |
| cache-version: ruby${{ env.RUBY_VERSION }} | |
| - name: Cache Gradle | |
| uses: ./.github/actions/cache-gradle | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| - name: Generate token for self repositories | |
| if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false }} | |
| uses: ./.github/actions/generate-github-token | |
| id: github-token | |
| with: | |
| app-id: ${{ vars.GH_WORKFLOWS_CROSS_ACCESS_ID }} | |
| private-key: ${{ secrets.GH_WORKFLOWS_CROSS_ACCESS_KEY }} | |
| configure-netrc: "true" | |
| - name: Install Mobile Dependencies | |
| uses: ./.github/actions/mobile-setup | |
| with: | |
| app_path: ${{ env.APP_PATH }} | |
| node_version: ${{ env.NODE_VERSION }} | |
| ruby_version: ${{ env.RUBY_VERSION }} | |
| workspace: ${{ env.WORKSPACE }} | |
| env: | |
| SELFXYZ_APP_TOKEN: ${{ steps.github-token.outputs.token }} | |
| - name: Build dependencies | |
| shell: bash | |
| run: pnpm --filter @selfxyz/common build | |
| - name: Run Android analysis | |
| env: | |
| # Prevent V8 heap OOM during Metro bundle generation on larger dependency graphs | |
| NODE_OPTIONS: --max-old-space-size=8192 | |
| run: pnpm analyze:bundle:android | |
| working-directory: ./app | |
| analyze-ios: | |
| if: | | |
| github.event_name == 'workflow_dispatch' || | |
| (github.event_name == 'push' && contains(fromJSON('["refs/heads/staging","refs/heads/main"]'), github.ref)) || | |
| (github.event_name == 'pull_request' && contains(fromJSON('["staging","main"]'), github.base_ref)) || | |
| (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'test-ios')) | |
| # runs-on: macos-latest-large | |
| runs-on: namespace-profile-apple-silicon-6cpu | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Read and sanitize Node.js version | |
| shell: bash | |
| run: | | |
| if [ ! -f .nvmrc ] || [ -z "$(cat .nvmrc)" ]; then | |
| echo "❌ .nvmrc is missing or empty"; exit 1; | |
| fi | |
| VERSION="$(tr -d '\r\n' < .nvmrc)" | |
| VERSION="${VERSION#v}" | |
| if ! [[ "$VERSION" =~ ^[0-9]+(\.[0-9]+){0,2}$ ]]; then | |
| echo "Invalid .nvmrc content: '$VERSION'"; exit 1; | |
| fi | |
| echo "NODE_VERSION=$VERSION" >> "$GITHUB_ENV" | |
| echo "NODE_VERSION_SANITIZED=${VERSION//\//-}" >> "$GITHUB_ENV" | |
| - name: Use Node.js | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Cache pnpm store | |
| uses: ./.github/actions/cache-pnpm | |
| with: | |
| cache-version: node-${{ env.NODE_VERSION_SANITIZED }} | |
| - name: Cache Bundler | |
| uses: ./.github/actions/cache-bundler | |
| with: | |
| path: app/vendor/bundle | |
| lock-file: app/Gemfile.lock | |
| cache-version: ruby${{ env.RUBY_VERSION }} | |
| - name: Cache CocoaPods | |
| uses: ./.github/actions/cache-pods | |
| with: | |
| path: app/ios/Pods | |
| lockfile: app/ios/Podfile.lock | |
| - name: Check Java installation | |
| run: | | |
| echo "INSTALL_JAVA=false" >> "$GITHUB_ENV" | |
| if command -v java &> /dev/null && java -version &> /dev/null; then | |
| echo "Java already installed: $(java -version 2>&1 | head -n 1)" | |
| else | |
| echo "Java not found or not working, will install..." | |
| echo "INSTALL_JAVA=true" >> "$GITHUB_ENV" | |
| fi | |
| - name: Setup Java environment | |
| if: env.INSTALL_JAVA == 'true' | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: "temurin" | |
| java-version: ${{ env.JAVA_VERSION }} | |
| - name: Generate token for self repositories | |
| if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false }} | |
| uses: ./.github/actions/generate-github-token | |
| id: github-token | |
| with: | |
| app-id: ${{ vars.GH_WORKFLOWS_CROSS_ACCESS_ID }} | |
| private-key: ${{ secrets.GH_WORKFLOWS_CROSS_ACCESS_KEY }} | |
| configure-netrc: "true" | |
| - name: Install Mobile Dependencies | |
| uses: ./.github/actions/mobile-setup | |
| with: | |
| app_path: ${{ env.APP_PATH }} | |
| node_version: ${{ env.NODE_VERSION }} | |
| ruby_version: ${{ env.RUBY_VERSION }} | |
| workspace: ${{ env.WORKSPACE }} | |
| env: | |
| SELFXYZ_APP_TOKEN: ${{ steps.github-token.outputs.token }} | |
| - name: Build dependencies | |
| shell: bash | |
| run: pnpm --filter @selfxyz/common build | |
| - name: Run iOS analysis | |
| env: | |
| # Keep parity with Android analysis to avoid platform-specific heap regressions | |
| NODE_OPTIONS: --max-old-space-size=8192 | |
| run: pnpm analyze:bundle:ios | |
| working-directory: ./app |