Skip to content
Source
Sign inSign up
Open History to see the last commit

mobile-showcase-screenshots.yml

183 lines6.2 KB

1name: Mobile Showcase Screenshots
2​
3on:
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​
38permissions:
39 contents: read
40​
41env:
42 NODE_OPTIONS: --max-old-space-size=8192
43​
44jobs:
45 ios:
46 name: iPhone, iPhone Duo, 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@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
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@250f29ce396baf5e8f24498e17c0dfdebabc26eb # v1.15.0
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: Install foldable simulator controls
91 run: npm install --global agent-device@0.21.36
92​
93 - name: Capture iOS showcase
94 run: pnpm screenshots:mobile --platform ios --appearance "${{ inputs.appearance }}" --theme "${{ inputs.theme }}"
95​
96 - name: Validate App Store Connect assets
97 run: pnpm screenshots:mobile --platform ios --appearance "${{ inputs.appearance }}" --theme "${{ inputs.theme }}" --validate-only
98​
99 - name: Upload iOS screenshots
100 if: always()
101 uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
102 with:
103 name: app-store-connect-screenshots
104 path: artifacts/app-store/screenshots/apple/
105 if-no-files-found: warn
106 retention-days: 14
107​
108 android:
109 name: Android phone, 7-inch tablet, and 10-inch tablet
110 if: inputs.platform == 'all' || inputs.platform == 'android'
111 runs-on: blacksmith-16vcpu-ubuntu-2404
112 # Capturing every palette multiplies the device matrix by six, and only the
113 # one native build is shared between them.
114 timeout-minutes: ${{ inputs.theme == 'all' && 300 || 60 }}
115 env:
116 T3_SHOWCASE_ANDROID_ABI: x86_64
117 steps:
118 - name: Checkout
119 uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
120 with:
121 sparse-checkout: |
122 /*
123 !/.repos/
124 sparse-checkout-cone-mode: false
125​
126 - name: Setup Vite+
127 uses: voidzero-dev/setup-vp@250f29ce396baf5e8f24498e17c0dfdebabc26eb # v1.15.0
128 with:
129 node-version-file: package.json
130 cache: true
131 run-install: |
132 args:
133 - --filter=@t3tools/mobile...
134 - --filter=@t3tools/scripts...
135 - --filter=t3...
136​
137 - name: Expose pnpm
138 run: |
139 pnpm_version="$(node --print "require('./package.json').packageManager.split('@').pop()")"
140 vp_pnpm_bin="$HOME/.vite-plus/package_manager/pnpm/$pnpm_version/pnpm/bin"
141 echo "$vp_pnpm_bin" >> "$GITHUB_PATH"
142 "$vp_pnpm_bin/pnpm" --version
143​
144 - name: Setup Java
145 uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0
146 with:
147 distribution: temurin
148 java-version: 17
149​
150 - name: Setup Gradle cache
151 uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
152​
153 - name: Enable KVM
154 run: |
155 echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS="static_node=kvm"' \
156 | sudo tee /etc/udev/rules.d/99-kvm4all.rules
157 sudo udevadm control --reload-rules
158 sudo udevadm trigger --name-match=kvm
159​
160 - name: Capture Android showcase
161 uses: reactivecircus/android-emulator-runner@a421e43855164a8197daf9d8d40fe71c6996bb0d # v2.38.0
162 with:
163 api-level: 36
164 target: google_apis
165 arch: x86_64
166 profile: pixel_7_pro
167 avd-name: Pixel_10_Pro
168 cores: 8
169 ram-size: 4096M
170 disable-animations: false
171 script: pnpm screenshots:mobile --platform android --appearance "${{ inputs.appearance }}" --theme "${{ inputs.theme }}"
172​
173 - name: Validate Google Play assets
174 run: pnpm screenshots:mobile --platform android --appearance "${{ inputs.appearance }}" --theme "${{ inputs.theme }}" --validate-only
175​
176 - name: Upload Android screenshots
177 if: always()
178 uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
179 with:
180 name: google-play-screenshots
181 path: artifacts/app-store/screenshots/google-play/
182 if-no-files-found: warn
183 retention-days: 14