| 1 | name: Mobile Showcase Screenshots |
| 2 | |
| 3 | on: |
| 4 | workflow_dispatch: |
| 5 | inputs: |
| 6 | platform: |
| 7 | description: Device platforms to capture |
| 8 | required: true |
| 9 | default: all |
| 10 | type: choice |
| 11 | options: |
| 12 | - all |
| 13 | - ios |
| 14 | - android |
| 15 | appearance: |
| 16 | description: System appearances to capture |
| 17 | required: true |
| 18 | default: both |
| 19 | type: choice |
| 20 | options: |
| 21 | - both |
| 22 | - dark |
| 23 | - light |
| 24 | theme: |
| 25 | description: Palette to capture (all multiplies the run by six) |
| 26 | required: true |
| 27 | default: t3-code |
| 28 | type: choice |
| 29 | options: |
| 30 | - t3-code |
| 31 | - t3-chat |
| 32 | - grove |
| 33 | - ocean |
| 34 | - ember |
| 35 | - iris |
| 36 | - all |
| 37 | |
| 38 | permissions: |
| 39 | contents: read |
| 40 | |
| 41 | env: |
| 42 | NODE_OPTIONS: --max-old-space-size=8192 |
| 43 | |
| 44 | jobs: |
| 45 | ios: |
| 46 | name: iPhone 6.9, iPhone 6.5, and iPad 13 |
| 47 | if: inputs.platform == 'all' || inputs.platform == 'ios' |
| 48 | runs-on: blacksmith-12vcpu-macos-26 |
| 49 | # Capturing every palette multiplies the device matrix by six, and only the |
| 50 | # one native build is shared between them. |
| 51 | timeout-minutes: ${{ inputs.theme == 'all' && 300 || 60 }} |
| 52 | steps: |
| 53 | - name: Checkout |
| 54 | uses: actions/checkout@v6 |
| 55 | with: |
| 56 | sparse-checkout: | |
| 57 | /* |
| 58 | !/.repos/ |
| 59 | sparse-checkout-cone-mode: false |
| 60 | |
| 61 | - name: Setup Vite+ |
| 62 | uses: voidzero-dev/setup-vp@v1 |
| 63 | with: |
| 64 | node-version-file: package.json |
| 65 | cache: true |
| 66 | run-install: | |
| 67 | args: |
| 68 | - --filter=@t3tools/mobile... |
| 69 | - --filter=@t3tools/scripts... |
| 70 | - --filter=t3... |
| 71 | |
| 72 | - name: Expose pnpm |
| 73 | run: | |
| 74 | pnpm_version="$(node --print "require('./package.json').packageManager.split('@').pop()")" |
| 75 | vp_pnpm_bin="$HOME/.vite-plus/package_manager/pnpm/$pnpm_version/pnpm/bin" |
| 76 | echo "$vp_pnpm_bin" >> "$GITHUB_PATH" |
| 77 | "$vp_pnpm_bin/pnpm" --version |
| 78 | |
| 79 | - name: Install AXe |
| 80 | # Locks the simulator and answers the notification prompt for the |
| 81 | # agent-activity scene. |
| 82 | # Homebrew refuses third-party tap formulae until they are trusted; |
| 83 | # older releases have no trust command and install them as is. |
| 84 | run: | |
| 85 | brew tap cameroncooke/axe |
| 86 | if brew commands | grep -qx trust; then brew trust --formula cameroncooke/axe/axe; fi |
| 87 | brew install cameroncooke/axe/axe |
| 88 | axe --version |
| 89 | |
| 90 | - name: Capture iOS showcase |
| 91 | run: pnpm screenshots:mobile --platform ios --appearance "${{ inputs.appearance }}" --theme "${{ inputs.theme }}" |
| 92 | |
| 93 | - name: Validate App Store Connect assets |
| 94 | run: pnpm screenshots:mobile --platform ios --appearance "${{ inputs.appearance }}" --theme "${{ inputs.theme }}" --validate-only |
| 95 | |
| 96 | - name: Upload iOS screenshots |
| 97 | if: always() |
| 98 | uses: actions/upload-artifact@v7 |
| 99 | with: |
| 100 | name: app-store-connect-screenshots |
| 101 | path: artifacts/app-store/screenshots/apple/ |
| 102 | if-no-files-found: warn |
| 103 | retention-days: 14 |
| 104 | |
| 105 | android: |
| 106 | name: Android phone, 7-inch tablet, and 10-inch tablet |
| 107 | if: inputs.platform == 'all' || inputs.platform == 'android' |
| 108 | runs-on: blacksmith-16vcpu-ubuntu-2404 |
| 109 | # Capturing every palette multiplies the device matrix by six, and only the |
| 110 | # one native build is shared between them. |
| 111 | timeout-minutes: ${{ inputs.theme == 'all' && 300 || 60 }} |
| 112 | env: |
| 113 | T3_SHOWCASE_ANDROID_ABI: x86_64 |
| 114 | steps: |
| 115 | - name: Checkout |
| 116 | uses: actions/checkout@v6 |
| 117 | with: |
| 118 | sparse-checkout: | |
| 119 | /* |
| 120 | !/.repos/ |
| 121 | sparse-checkout-cone-mode: false |
| 122 | |
| 123 | - name: Setup Vite+ |
| 124 | uses: voidzero-dev/setup-vp@v1 |
| 125 | with: |
| 126 | node-version-file: package.json |
| 127 | cache: true |
| 128 | run-install: | |
| 129 | args: |
| 130 | - --filter=@t3tools/mobile... |
| 131 | - --filter=@t3tools/scripts... |
| 132 | - --filter=t3... |
| 133 | |
| 134 | - name: Expose pnpm |
| 135 | run: | |
| 136 | pnpm_version="$(node --print "require('./package.json').packageManager.split('@').pop()")" |
| 137 | vp_pnpm_bin="$HOME/.vite-plus/package_manager/pnpm/$pnpm_version/pnpm/bin" |
| 138 | echo "$vp_pnpm_bin" >> "$GITHUB_PATH" |
| 139 | "$vp_pnpm_bin/pnpm" --version |
| 140 | |
| 141 | - name: Setup Java |
| 142 | uses: actions/setup-java@v5 |
| 143 | with: |
| 144 | distribution: temurin |
| 145 | java-version: 17 |
| 146 | |
| 147 | - name: Setup Gradle cache |
| 148 | uses: gradle/actions/setup-gradle@v5 |
| 149 | |
| 150 | - name: Enable KVM |
| 151 | run: | |
| 152 | echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS="static_node=kvm"' \ |
| 153 | | sudo tee /etc/udev/rules.d/99-kvm4all.rules |
| 154 | sudo udevadm control --reload-rules |
| 155 | sudo udevadm trigger --name-match=kvm |
| 156 | |
| 157 | - name: Capture Android showcase |
| 158 | uses: reactivecircus/android-emulator-runner@v2 |
| 159 | with: |
| 160 | api-level: 36 |
| 161 | target: google_apis |
| 162 | arch: x86_64 |
| 163 | profile: pixel_7_pro |
| 164 | avd-name: Pixel_10_Pro |
| 165 | cores: 8 |
| 166 | ram-size: 4096M |
| 167 | disable-animations: false |
| 168 | script: pnpm screenshots:mobile --platform android --appearance "${{ inputs.appearance }}" --theme "${{ inputs.theme }}" |
| 169 | |
| 170 | - name: Validate Google Play assets |
| 171 | run: pnpm screenshots:mobile --platform android --appearance "${{ inputs.appearance }}" --theme "${{ inputs.theme }}" --validate-only |
| 172 | |
| 173 | - name: Upload Android screenshots |
| 174 | if: always() |
| 175 | uses: actions/upload-artifact@v7 |
| 176 | with: |
| 177 | name: google-play-screenshots |
| 178 | path: artifacts/app-store/screenshots/google-play/ |
| 179 | if-no-files-found: warn |
| 180 | retention-days: 14 |