Skip to content

Commit 677e67b

Browse files
committed
Merge commit '961026c6c98118a5017888a8cb6ed7078db140eb' into ready/mobile-25314
2 parents 766763d + 961026c commit 677e67b

1,196 files changed

Lines changed: 60507 additions & 7069 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/agent-context-budget.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@ jobs:
5151
echo "Accepted by the agent-context-increase label."
5252
exit 0
5353
fi
54-
echo "::error file=$BUDGET::Agent context grew compared to main. Cut the added text, or ask a maintainer to add the agent-context-increase label."
54+
echo "::error file=$BUDGET::Agent context grew compared to main. Cut the added text and rerun the evals that cover it (evals/README.md), or ask a maintainer to add the agent-context-increase label."
5555
exit 1
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
name: Mobile EAS Preview (Fork)
2+
3+
# EAS previews for fork PRs. This runs the PR's code with an Expo token: the
4+
# app config and plugins run on this runner, and native builds run on EAS
5+
# with preview signing credentials. The label is the maintainer's sign-off
6+
# that they reviewed that code, so it covers exactly the commit it was applied
7+
# to: this pins that commit and consumes the label before running anything. A
8+
# later push deploys nothing until the label is applied again.
9+
#
10+
# Same-repo PRs deploy on every push while labeled, via mobile-eas-preview.yml.
11+
12+
on:
13+
pull_request_target:
14+
types: [labeled]
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
preview:
21+
name: EAS Preview
22+
if: >-
23+
github.event.pull_request.head.repo.full_name != github.repository &&
24+
github.event.label.name == '🚀 Mobile Continuous Deployment'
25+
runs-on: blacksmith-8vcpu-ubuntu-2404
26+
concurrency:
27+
group: mobile-eas-preview-fork-${{ github.event.pull_request.number }}
28+
cancel-in-progress: true
29+
permissions:
30+
contents: read
31+
pull-requests: write
32+
env:
33+
APP_VARIANT: preview
34+
NODE_OPTIONS: --max-old-space-size=8192
35+
MOBILE_VERSION_POLICY: fingerprint
36+
steps:
37+
# If a maintainer removed the label first, that removal wins.
38+
- id: consume
39+
name: Consume the deployment label
40+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
41+
with:
42+
script: |
43+
try {
44+
await github.rest.issues.removeLabel({
45+
owner: context.repo.owner,
46+
repo: context.repo.repo,
47+
issue_number: context.payload.pull_request.number,
48+
name: context.payload.label.name,
49+
});
50+
core.setOutput("consumed", "true");
51+
} catch (error) {
52+
if (error.status !== 404) throw error;
53+
core.info("The label was removed before this run could consume it. Skipping.");
54+
core.setOutput("consumed", "false");
55+
}
56+
57+
- id: expo-token
58+
name: Check for EXPO_PREVIEW_TOKEN
59+
if: steps.consume.outputs.consumed == 'true'
60+
env:
61+
EXPO_TOKEN: ${{ secrets.EXPO_PREVIEW_TOKEN }}
62+
run: |
63+
if [ -n "$EXPO_TOKEN" ]; then
64+
echo "present=true" >> "$GITHUB_OUTPUT"
65+
else
66+
echo "present=false" >> "$GITHUB_OUTPUT"
67+
echo "EXPO_PREVIEW_TOKEN is not set; skipping EAS preview."
68+
fi
69+
70+
# The head SHA from the label event, not the branch, so a push after the
71+
# label cannot swap in unreviewed code. No credentials stay in .git for
72+
# the PR's scripts to read.
73+
- name: Checkout reviewed commit
74+
if: steps.expo-token.outputs.present == 'true'
75+
uses: actions/checkout@v6
76+
with:
77+
ref: ${{ github.event.pull_request.head.sha }}
78+
fetch-depth: 0
79+
persist-credentials: false
80+
# No sparse-checkout: see mobile-eas-preview.yml.
81+
82+
# No caches: pull_request_target saves them under main's scope, where
83+
# trusted workflows with other secrets would restore what PR code wrote.
84+
- name: Setup Vite+
85+
if: steps.expo-token.outputs.present == 'true'
86+
uses: voidzero-dev/setup-vp@v1
87+
with:
88+
node-version-file: package.json
89+
cache: false
90+
run-install: |
91+
args:
92+
- --filter=@t3tools/mobile...
93+
94+
- name: Expose pnpm
95+
if: steps.expo-token.outputs.present == 'true'
96+
run: |
97+
pnpm_version="$(node --print "require('./package.json').packageManager.split('@').pop()")"
98+
vp_pnpm_bin="$HOME/.vite-plus/package_manager/pnpm/$pnpm_version/pnpm/bin"
99+
echo "$vp_pnpm_bin" >> "$GITHUB_PATH"
100+
"$vp_pnpm_bin/pnpm" --version
101+
102+
- name: Setup EAS
103+
if: steps.expo-token.outputs.present == 'true'
104+
uses: expo/expo-github-action@v8
105+
with:
106+
# Pinned and installed with npm for the same reasons as mobile-eas-preview.yml.
107+
eas-version: 21.8.0
108+
eas-cache: false
109+
token: ${{ secrets.EXPO_PREVIEW_TOKEN }}
110+
packager: npm
111+
112+
- name: Pull preview environment variables
113+
if: steps.expo-token.outputs.present == 'true'
114+
working-directory: apps/mobile
115+
env:
116+
EXPO_TOKEN: ${{ secrets.EXPO_PREVIEW_TOKEN }}
117+
run: |
118+
eas env:pull preview --non-interactive
119+
# See mobile-eas-preview.yml: keeps Android build and OTA fingerprints matching.
120+
node --input-type=module <<'NODE'
121+
import { appendFileSync, readFileSync } from "node:fs";
122+
import { parseEnv } from "node:util";
123+
const env = parseEnv(readFileSync(".env.local", "utf8"));
124+
const googleServicesFile = env.T3CODE_ANDROID_GOOGLE_SERVICES_FILE;
125+
if (googleServicesFile) {
126+
appendFileSync(process.env.GITHUB_ENV, `T3CODE_ANDROID_GOOGLE_SERVICES_FILE=${googleServicesFile}\n`);
127+
}
128+
NODE
129+
130+
- name: Deploy with fingerprint check
131+
if: steps.expo-token.outputs.present == 'true'
132+
uses: expo/expo-github-action/continuous-deploy-fingerprint@main
133+
env:
134+
EXPO_TOKEN: ${{ secrets.EXPO_PREVIEW_TOKEN }}
135+
RUNNER_DEBUG: "1"
136+
# The action only comments for pull_request events; this hook gives
137+
# it the PR under pull_request_target. Without it, it skips the comment.
138+
EXPO_TEST_GITHUB_PULL: ${{ github.event.pull_request.number }}
139+
with:
140+
profile: preview:dev
141+
branch: pr-${{ github.event.pull_request.number }}
142+
platform: all
143+
environment: preview
144+
working-directory: apps/mobile
145+
github-token: ${{ secrets.GITHUB_TOKEN }}

‎.github/workflows/mobile-eas-preview.yml‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ on:
77
jobs:
88
preview:
99
name: EAS Preview
10+
# Fork PRs deploy one reviewed commit per label through mobile-eas-preview-fork.yml.
1011
if: |
12+
github.event.pull_request.head.repo.full_name == github.repository &&
1113
contains(github.event.pull_request.labels.*.name, '🚀 Mobile Continuous Deployment') &&
1214
(github.event.action != 'labeled' || github.event.label.name == '🚀 Mobile Continuous Deployment')
1315
runs-on: blacksmith-8vcpu-ubuntu-2404
@@ -23,15 +25,15 @@ jobs:
2325
MOBILE_VERSION_POLICY: fingerprint
2426
steps:
2527
- id: expo-token
26-
name: Check for EXPO_TOKEN
28+
name: Check for EXPO_PREVIEW_TOKEN
2729
env:
28-
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
30+
EXPO_TOKEN: ${{ secrets.EXPO_PREVIEW_TOKEN }}
2931
run: |
3032
if [ -n "$EXPO_TOKEN" ]; then
3133
echo "present=true" >> "$GITHUB_OUTPUT"
3234
else
3335
echo "present=false" >> "$GITHUB_OUTPUT"
34-
echo "EXPO_TOKEN is not available; skipping EAS preview."
36+
echo "EXPO_PREVIEW_TOKEN is not available; skipping EAS preview."
3537
fi
3638
3739
- name: Checkout
@@ -70,7 +72,7 @@ jobs:
7072
# continuous-deploy-fingerprint still reads `build.project.ownerAccount`.
7173
# Unpin once https://github.com/expo/expo-github-action/issues/358 is fixed.
7274
eas-version: 21.8.0
73-
token: ${{ secrets.EXPO_TOKEN }}
75+
token: ${{ secrets.EXPO_PREVIEW_TOKEN }}
7476
# npm, not pnpm: this only installs eas-cli into the action's own
7577
# tool dir, and pnpm 11 hard-fails that install on dtrace-provider's
7678
# ignored build script (no allowBuilds config outside the repo).
@@ -80,7 +82,7 @@ jobs:
8082
if: steps.expo-token.outputs.present == 'true'
8183
working-directory: apps/mobile
8284
env:
83-
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
85+
EXPO_TOKEN: ${{ secrets.EXPO_PREVIEW_TOKEN }}
8486
run: |
8587
eas env:pull preview --non-interactive
8688
# EAS Update disables dotenv loading. Keep the downloaded native config
@@ -99,7 +101,7 @@ jobs:
99101
if: steps.expo-token.outputs.present == 'true'
100102
uses: expo/expo-github-action/continuous-deploy-fingerprint@main
101103
env:
102-
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
104+
EXPO_TOKEN: ${{ secrets.EXPO_PREVIEW_TOKEN }}
103105
# The Expo action otherwise suppresses the EAS command's failure output.
104106
RUNNER_DEBUG: "1"
105107
with:

‎.github/workflows/mobile-eas-production.yml‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@ jobs:
9797
- id: expo-token
9898
name: Check for EXPO_TOKEN
9999
env:
100-
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
100+
EXPO_TOKEN: ${{ secrets.EXPO_PRODUCTION_TOKEN }}
101101
run: |
102102
if [ -n "$EXPO_TOKEN" ]; then
103103
echo "present=true" >> "$GITHUB_OUTPUT"
104104
else
105105
echo "present=false" >> "$GITHUB_OUTPUT"
106-
echo "EXPO_TOKEN is not available; skipping EAS production job."
106+
echo "EXPO_PRODUCTION_TOKEN is not available; skipping EAS production job."
107107
fi
108108
109109
- id: version_app_token
@@ -149,7 +149,7 @@ jobs:
149149
uses: expo/expo-github-action@v8
150150
with:
151151
eas-version: latest
152-
token: ${{ secrets.EXPO_TOKEN }}
152+
token: ${{ secrets.EXPO_PRODUCTION_TOKEN }}
153153
# npm, not pnpm: this only installs eas-cli into the action's own
154154
# tool dir, and pnpm 11 hard-fails that install on dtrace-provider's
155155
# ignored build script (no allowBuilds config outside the repo).
@@ -159,7 +159,7 @@ jobs:
159159
if: steps.expo-token.outputs.present == 'true'
160160
working-directory: apps/mobile
161161
env:
162-
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
162+
EXPO_TOKEN: ${{ secrets.EXPO_PRODUCTION_TOKEN }}
163163
run: |
164164
eas env:pull production --non-interactive
165165
# EAS commands skip dotenv, and the Android fingerprint hashes this
@@ -244,7 +244,7 @@ jobs:
244244
if: steps.expo-token.outputs.present == 'true' && github.event_name == 'workflow_dispatch' && inputs.mode == 'build'
245245
working-directory: apps/mobile
246246
env:
247-
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
247+
EXPO_TOKEN: ${{ secrets.EXPO_PRODUCTION_TOKEN }}
248248
MOBILE_BUILD_PROFILE: ${{ inputs.profile || 'production' }}
249249
run: eas build --platform ${{ inputs.platform }} --profile "$MOBILE_BUILD_PROFILE" --auto-submit --non-interactive --no-wait
250250

@@ -255,7 +255,7 @@ jobs:
255255
if: steps.expo-token.outputs.present == 'true' && (github.event_name == 'push' || inputs.mode == 'update')
256256
working-directory: apps/mobile
257257
env:
258-
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
258+
EXPO_TOKEN: ${{ secrets.EXPO_PRODUCTION_TOKEN }}
259259
PLATFORM: ${{ inputs.platform || 'all' }}
260260
run: |
261261
if [ "$PLATFORM" = "all" ]; then platforms="ios android"; else platforms="$PLATFORM"; fi
@@ -275,7 +275,7 @@ jobs:
275275
if: steps.expo-token.outputs.present == 'true' && github.event_name == 'workflow_dispatch' && inputs.mode == 'update'
276276
working-directory: apps/mobile
277277
env:
278-
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
278+
EXPO_TOKEN: ${{ secrets.EXPO_PRODUCTION_TOKEN }}
279279
MOBILE_BUILD_PROFILE: ${{ inputs.profile || 'production' }}
280280
OTA_MESSAGE: ${{ inputs.message || format('Production OTA ({0})', github.sha) }}
281281
run: |
@@ -299,7 +299,7 @@ jobs:
299299
if: steps.expo-token.outputs.present == 'true' && github.event_name == 'push'
300300
working-directory: apps/mobile
301301
env:
302-
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
302+
EXPO_TOKEN: ${{ secrets.EXPO_PRODUCTION_TOKEN }}
303303
run: |
304304
failed=0
305305
message="$(git log -1 --pretty=%s | head -c 120) ($(git rev-parse --short=9 HEAD))"

‎.github/workflows/release-desktop.yml‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,15 @@ jobs:
390390
mkdir -p "$target_dir"
391391
cp "native/resource-monitor/target/${{ inputs.rust_target }}/release/${binary_name}" "$target_dir/$binary_name"
392392
393+
- uses: ./.github/actions/setup-apt-mirrors
394+
if: inputs.platform == 'linux'
395+
396+
# The Linux archive ships libatomic.so.1 and points t3's RUNPATH at it.
397+
- name: Install patchelf
398+
if: inputs.cli_archive && inputs.platform == 'linux'
399+
shell: bash
400+
run: command -v patchelf || { sudo apt-get update && sudo apt-get install -y patchelf; }
401+
393402
- name: Build CLI archive
394403
if: inputs.cli_archive
395404
shell: bash
@@ -433,9 +442,6 @@ jobs:
433442
path: release-cli/*
434443
if-no-files-found: error
435444

436-
- uses: ./.github/actions/setup-apt-mirrors
437-
if: inputs.platform == 'linux'
438-
439445
- name: Install Linux desktop build libraries
440446
if: inputs.platform == 'linux'
441447
shell: bash

‎.github/workflows/release.yml‎

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -762,11 +762,16 @@ jobs:
762762
timeout-minutes: 30
763763
permissions:
764764
contents: write
765+
# Release notes read PR bodies and authors.
766+
pull-requests: read
765767
steps:
766768
- name: Checkout
767769
uses: actions/checkout@v6
768770
with:
769771
ref: ${{ needs.preflight.outputs.ref }}
772+
# Release notes need history back to the previous tag, not file contents.
773+
fetch-depth: 0
774+
filter: blob:none
770775
sparse-checkout: |
771776
/*
772777
!/.repos/
@@ -892,6 +897,27 @@ jobs:
892897
echo 'EOF'
893898
} >> "$GITHUB_OUTPUT"
894899
900+
# A short model summary over GitHub's full list. Without a notes file, the
901+
# release falls back to GitHub's generated notes.
902+
- name: Write release notes
903+
if: needs.preflight.outputs.release_channel != 'preview' && needs.preflight.outputs.previous_tag != ''
904+
continue-on-error: true
905+
timeout-minutes: 5
906+
env:
907+
GH_TOKEN: ${{ github.token }}
908+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
909+
run: |
910+
node scripts/generate-release-notes.ts \
911+
--repository "${{ github.repository }}" \
912+
--tag "${{ needs.preflight.outputs.tag }}" \
913+
--ref "${{ needs.preflight.outputs.ref }}" \
914+
--previous-tag "${{ needs.preflight.outputs.previous_tag }}" \
915+
--version "${{ needs.preflight.outputs.version }}" \
916+
--output release-notes.md
917+
if [[ -f release-notes.md ]]; then
918+
cat release-notes.md >> "$GITHUB_STEP_SUMMARY"
919+
fi
920+
895921
# A preview release gets a warning instead of generated notes. Generated
896922
# notes would list every commit since the previous preview, which is
897923
# unmerged branch history no one should read as a changelog, and would
@@ -917,10 +943,11 @@ jobs:
917943
tag_name: ${{ needs.preflight.outputs.tag }}
918944
target_commitish: ${{ needs.preflight.outputs.ref }}
919945
name: ${{ needs.preflight.outputs.release_name }}
920-
generate_release_notes: ${{ needs.preflight.outputs.release_channel != 'preview' }}
921-
body_path: ${{ needs.preflight.outputs.release_channel == 'preview' && 'release-notes.md' || '' }}
946+
generate_release_notes: ${{ hashFiles('release-notes.md') == '' }}
947+
body_path: ${{ hashFiles('release-notes.md') != '' && 'release-notes.md' || '' }}
922948
previous_tag: ${{ needs.preflight.outputs.previous_tag }}
923949
prerelease: ${{ needs.preflight.outputs.is_prerelease }}
950+
draft: ${{ needs.preflight.outputs.is_prerelease }}
924951
make_latest: ${{ needs.preflight.outputs.make_latest }}
925952
files: ${{ steps.release_files.outputs.files }}
926953
fail_on_unmatched_files: true
@@ -936,11 +963,23 @@ jobs:
936963
generate_release_notes: ${{ needs.preflight.outputs.release_channel != 'preview' }}
937964
body_path: ${{ needs.preflight.outputs.release_channel == 'preview' && 'release-notes.md' || '' }}
938965
prerelease: ${{ needs.preflight.outputs.is_prerelease }}
966+
draft: ${{ needs.preflight.outputs.is_prerelease }}
939967
make_latest: ${{ needs.preflight.outputs.make_latest }}
940968
files: ${{ steps.release_files.outputs.files }}
941969
fail_on_unmatched_files: true
942970
token: ${{ github.token }}
943971

972+
# The action keeps a stable release a draft until its assets finish uploading, but publishes a
973+
# prerelease first. Desktop clients update connected servers from the CLI archives as soon as
974+
# they see the release, so a prerelease also goes public only once every asset is attached.
975+
- name: Publish prerelease
976+
if: needs.preflight.outputs.is_prerelease == 'true'
977+
env:
978+
GH_TOKEN: ${{ github.token }}
979+
GH_REPO: ${{ github.repository }}
980+
RELEASE_TAG: ${{ needs.preflight.outputs.tag }}
981+
run: gh release edit "$RELEASE_TAG" --draft=false
982+
944983
# The `t3` npm package is a launcher that downloads this version's CLI
945984
# archive from the GitHub Release, so it publishes only once that release
946985
# exists. Preview publishes too, under the `preview` dist-tag, which

0 commit comments

Comments
 (0)