-
Notifications
You must be signed in to change notification settings - Fork 3.7k
feat(marketing): T3 Connect story, agent-subscription hero, minimal connect scene #5296
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
base: main
Are you sure you want to change the base?
Changes from all commits
3a552a4
cc2fa0b
b88912f
cc1b7b1
4a8f40c
7f7d1c7
30dfba2
c6d9103
fbcdbd9
03ad061
612837c
e664383
86b5c28
1f1d583
800d9ee
0df16ea
c78df09
ba2b3ed
a32d658
c29d56a
e96b0bb
be2cf81
8728406
9c752c9
25eaf62
eb1f024
b57c453
3e799b7
7012855
13c7c3b
37bd394
f52b5aa
1b6995e
e4d4592
cc0a33d
e753967
bd980eb
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 |
|---|---|---|
|
|
@@ -34,6 +34,8 @@ jobs: | |
| if: inputs.platform == 'all' || inputs.platform == 'ios' | ||
| runs-on: blacksmith-12vcpu-macos-26 | ||
| timeout-minutes: 60 | ||
| outputs: | ||
| artifact_id: ${{ steps.upload_ios.outputs.artifact-id }} | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
|
|
@@ -68,6 +70,7 @@ jobs: | |
| run: pnpm screenshots:mobile --platform ios --appearance "${{ inputs.appearance }}" --validate-only | ||
|
|
||
| - name: Upload iOS screenshots | ||
| id: upload_ios | ||
| if: always() | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
|
|
@@ -76,11 +79,160 @@ jobs: | |
| if-no-files-found: warn | ||
| retention-days: 14 | ||
|
|
||
| publish_marketing_preview: | ||
| name: Publish marketing mobile preview | ||
| if: | | ||
| always() && | ||
| needs.ios.result == 'success' && | ||
| needs.android.result == 'success' && | ||
| inputs.platform == 'all' && | ||
| github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && | ||
| inputs.appearance != 'light' | ||
| needs: [ios, android] | ||
| runs-on: blacksmith-8vcpu-ubuntu-2404 | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - id: app_token | ||
| name: Mint release app token | ||
| uses: actions/create-github-app-token@v2 | ||
| with: | ||
| app-id: ${{ secrets.RELEASE_APP_ID }} | ||
| private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }} | ||
| owner: ${{ github.repository_owner }} | ||
|
|
||
| - name: Checkout default branch | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| ref: ${{ github.event.repository.default_branch }} | ||
| fetch-depth: 0 | ||
| token: ${{ steps.app_token.outputs.token }} | ||
| persist-credentials: true | ||
|
cursor[bot] marked this conversation as resolved.
|
||
|
|
||
| - name: Download iOS screenshots | ||
| uses: actions/download-artifact@v8 | ||
| with: | ||
| name: app-store-connect-screenshots | ||
| path: ${{ runner.temp }}/mobile-showcase | ||
|
|
||
| - name: Download Android screenshots | ||
| uses: actions/download-artifact@v8 | ||
| with: | ||
| name: google-play-screenshots | ||
| path: ${{ runner.temp }}/mobile-showcase | ||
|
|
||
| - id: app_bot | ||
| name: Resolve GitHub App bot identity | ||
| env: | ||
| GH_TOKEN: ${{ steps.app_token.outputs.token }} | ||
| APP_SLUG: ${{ steps.app_token.outputs.app-slug }} | ||
| run: | | ||
| user_id="$(gh api "/users/${APP_SLUG}[bot]" --jq .id)" | ||
| echo "name=${APP_SLUG}[bot]" >> "$GITHUB_OUTPUT" | ||
| echo "email=${user_id}+${APP_SLUG}[bot]@users.noreply.github.com" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - id: preview | ||
| name: Update website preview asset | ||
| env: | ||
| IOS_ARTIFACT_ID: ${{ needs.ios.outputs.artifact_id }} | ||
| ANDROID_ARTIFACT_ID: ${{ needs.android.outputs.artifact_id }} | ||
| HEAD_SHA: ${{ github.sha }} | ||
| RUN_ID: ${{ github.run_id }} | ||
| RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
| WORKFLOW_NAME: ${{ github.workflow }} | ||
| run: | | ||
| output_directory="apps/marketing/public/mobile-states" | ||
| declare -A preview_sources=( | ||
| ["threads.png"]="$RUNNER_TEMP/mobile-showcase/iphone-6.9/dark/threads.png" | ||
| ["ipad-threads.png"]="$RUNNER_TEMP/mobile-showcase/ipad-13/dark/threads.png" | ||
| ["ios-thread.png"]="$RUNNER_TEMP/mobile-showcase/iphone-6.9/dark/thread.png" | ||
| ["ios-terminal.png"]="$RUNNER_TEMP/mobile-showcase/iphone-6.9/dark/terminal.png" | ||
| ["ios-review.png"]="$RUNNER_TEMP/mobile-showcase/iphone-6.9/dark/review.png" | ||
| ["ios-environments.png"]="$RUNNER_TEMP/mobile-showcase/iphone-6.9/dark/environments.png" | ||
| ["android-threads.png"]="$RUNNER_TEMP/mobile-showcase/phone/dark/threads.png" | ||
| ["android-thread.png"]="$RUNNER_TEMP/mobile-showcase/phone/dark/thread.png" | ||
| ["android-terminal.png"]="$RUNNER_TEMP/mobile-showcase/phone/dark/terminal.png" | ||
| ["android-review.png"]="$RUNNER_TEMP/mobile-showcase/phone/dark/review.png" | ||
| ["android-environments.png"]="$RUNNER_TEMP/mobile-showcase/phone/dark/environments.png" | ||
| ) | ||
|
|
||
| for output_name in "${!preview_sources[@]}"; do | ||
| source_path="${preview_sources[$output_name]}" | ||
| if [[ ! -f "$source_path" ]]; then | ||
| echo "Missing expected website preview source: $source_path" >&2 | ||
| exit 1 | ||
| fi | ||
| done | ||
|
|
||
| changed=false | ||
| for output_name in "${!preview_sources[@]}"; do | ||
| source_path="${preview_sources[$output_name]}" | ||
| output_path="$output_directory/$output_name" | ||
| if [[ ! -f "$output_path" ]] || ! cmp --silent "$source_path" "$output_path"; then | ||
| changed=true | ||
| break | ||
| fi | ||
| done | ||
|
|
||
| if [[ "$changed" == "false" ]]; then | ||
| echo "changed=false" >> "$GITHUB_OUTPUT" | ||
| echo "Website previews already match the generated screenshots." | ||
| exit 0 | ||
| fi | ||
|
|
||
| mkdir -p "$output_directory" | ||
| for output_name in "${!preview_sources[@]}"; do | ||
| cp "${preview_sources[$output_name]}" "$output_directory/$output_name" | ||
| done | ||
| node --input-type=module <<'NODE' | ||
| import { writeFile } from "node:fs/promises"; | ||
|
|
||
| const metadata = { | ||
| artifacts: [ | ||
| { | ||
| id: Number(process.env.IOS_ARTIFACT_ID), | ||
| name: "app-store-connect-screenshots", | ||
| }, | ||
| { | ||
| id: Number(process.env.ANDROID_ARTIFACT_ID), | ||
| name: "google-play-screenshots", | ||
| }, | ||
| ], | ||
| artifactCreatedAt: new Date().toISOString(), | ||
| runId: Number(process.env.RUN_ID), | ||
| runUrl: process.env.RUN_URL, | ||
| headSha: process.env.HEAD_SHA, | ||
| workflow: process.env.WORKFLOW_NAME, | ||
| devices: ["iphone-6.9", "ipad-13", "pixel"], | ||
| scenes: ["thread", "terminal", "review", "threads", "environments"], | ||
| appearance: "dark", | ||
| }; | ||
|
|
||
| await writeFile( | ||
| "apps/marketing/public/mobile-states/source.json", | ||
| `${JSON.stringify(metadata, null, 2)}\n`, | ||
| ); | ||
| NODE | ||
| echo "changed=true" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Commit website preview | ||
| if: steps.preview.outputs.changed == 'true' | ||
| env: | ||
| DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} | ||
| run: | | ||
| git config user.name "${{ steps.app_bot.outputs.name }}" | ||
| git config user.email "${{ steps.app_bot.outputs.email }}" | ||
| git add apps/marketing/public/mobile-states | ||
| git commit -m "chore(marketing): refresh mobile showcase screenshot" | ||
| git pull --rebase origin "$DEFAULT_BRANCH" | ||
| git push origin "HEAD:$DEFAULT_BRANCH" | ||
|
Contributor
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. Preview commit lacks conflict handlingMedium Severity The marketing preview commit runs Reviewed by Cursor Bugbot for commit eb1f024. Configure here. |
||
|
|
||
| android: | ||
| name: Android phone, 7-inch tablet, and 10-inch tablet | ||
| if: inputs.platform == 'all' || inputs.platform == 'android' | ||
| runs-on: blacksmith-16vcpu-ubuntu-2404 | ||
| timeout-minutes: 60 | ||
| outputs: | ||
| artifact_id: ${{ steps.upload_android.outputs.artifact-id }} | ||
| env: | ||
| T3_SHOWCASE_ANDROID_ABI: x86_64 | ||
| steps: | ||
|
|
@@ -143,6 +295,7 @@ jobs: | |
| run: pnpm screenshots:mobile --platform android --appearance "${{ inputs.appearance }}" --validate-only | ||
|
|
||
| - name: Upload Android screenshots | ||
| id: upload_android | ||
| if: always() | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,28 @@ | ||
| import { defineConfig } from "astro/config"; | ||
|
|
||
| const cacheSidebarDemoAssets = { | ||
| name: "cache-sidebar-demo-assets", | ||
| configureServer(server) { | ||
| server.middlewares.use((request, response, next) => { | ||
| if (request.url?.startsWith("/sidebar-demo/assets/")) { | ||
| response.setHeader("Cache-Control", "public, max-age=31536000, immutable"); | ||
| } else if ( | ||
| request.url?.startsWith("/demo-states/") || | ||
| request.url?.startsWith("/mobile-states/") | ||
| ) { | ||
| response.setHeader("Cache-Control", "public, max-age=3600, stale-while-revalidate=86400"); | ||
| } | ||
| next(); | ||
| }); | ||
| }, | ||
| }; | ||
|
|
||
| export default defineConfig({ | ||
| site: "https://t3.codes", | ||
| server: { | ||
| port: Number(process.env.PORT ?? 4173), | ||
| }, | ||
| vite: { | ||
| plugins: [cacheSidebarDemoAssets], | ||
| }, | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| { | ||
| "artifacts": [ | ||
| { | ||
| "id": 8791333399, | ||
| "name": "app-store-connect-screenshots" | ||
| }, | ||
| { | ||
| "id": 8791283952, | ||
| "name": "google-play-screenshots" | ||
| } | ||
| ], | ||
| "artifactCreatedAt": "2026-07-31T10:54:46Z", | ||
| "runId": 30625175356, | ||
| "runUrl": "https://github.com/pingdotgg/t3code/actions/runs/30625175356", | ||
| "headSha": "0647dbc12be4e83b95337eb0bccbeaa982967d39", | ||
| "workflow": "mobile-showcase-screenshots.yml", | ||
| "devices": ["iphone-6.9", "ipad-13", "pixel"], | ||
| "scenes": ["thread", "terminal", "review", "threads", "environments"], | ||
| "appearance": "dark" | ||
| } |


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.
🟡 Medium
workflows/mobile-showcase-screenshots.yml:104publish_marketing_previewchecks out the latest default branch instead of the${{ github.sha }}used by the iOS and Android capture jobs. When the default branch advances during the capture jobs, this job commits the older revision's screenshots into the newer branch, overwriting the current preview assets with stale output.The capture jobs build and screenshot the code at
${{ github.sha }}, butpublish_marketing_previewchecks out${{ github.event.repository.default_branch }}and pushes the generated screenshots there. Checkout${{ github.sha }}instead so the screenshots are committed to the same revision that produced them.- name: Checkout default branch uses: actions/checkout@v6 with: - ref: ${{ github.event.repository.default_branch }} + ref: ${{ github.sha }} fetch-depth: 0 token: ${{ steps.app_token.outputs.token }} persist-credentials: true🤖 Copy this AI Prompt to have your agent fix this: