@devries-cameron20 / t3code Mirror · read-only / commits / 11b00afc02
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 23, 09:15 UTC

chore(mobile): remove the legacy v2 preview channel (#20084)

Julius Marminge committed Oct 15, 2026 at 17:10 UTC 11b00afc0268d00692b668674f4b43bb4838795b
5 files changed +96 -87
.github/scripts/mirror-play-apk.cjs
+83 -41
@@ -86,7 +86,7 @@ function readRelease(tag) {
86 // Downloads the build's universal APK and uploads it, creating the release on
87 // first use. Returns false when Play lists no universal APK, which happens
88 // while it is still processing a fresh upload.
89 -async function uploadApk({ token, appUrl, build, tag, apkName, notes, release }) {
89 +async function uploadApk({ token, appUrl, build, tag, apkName, notes, title, release }) {
90 const generated = await (
91 await play(token, "GET", `${appUrl}/generatedApks/${build.versionCode}`)
92 ).json();
@@ -117,7 +117,7 @@ async function uploadApk({ token, appUrl, build, tag, apkName, notes, release })
117 "--prerelease",
118 "--latest=false",
119 "--title",
120 - "T3 Code for Android (nightly)",
120 + title,
121 "--notes",
122 notes,
123 );
@@ -129,8 +129,8 @@ async function uploadApk({ token, appUrl, build, tag, apkName, notes, release })
129
130 async function main() {
131 const packageName = requireEnv("PACKAGE_NAME");
132 - const trackName = requireEnv("PLAY_TRACK");
132 const tag = requireEnv("RELEASE_TAG");
133 + const title = "T3 Code for Android (testing)";
134 const key = JSON.parse(requireEnv("GOOGLE_PLAY_SERVICE_ACCOUNT_JSON"));
135 const summary = (line) =>
136 process.env.GITHUB_STEP_SUMMARY &&
@@ -138,48 +138,90 @@ async function main() {
138
139 const token = await playAccessToken(key);
140 const appUrl = `${PLAY_API}/${packageName}`;
141 - const build = await newestTrackBuild(token, appUrl, trackName);
142 - if (!build) {
143 - console.log(`The ${trackName} track has no live release.`);
144 - return;
145 - }
146 -
147 - const safeName = build.versionName.replace(/[^0-9A-Za-z.]+/g, "-").replace(/^-|-$/g, "");
148 - const apkName = `t3code-android-${safeName}-${build.versionCode}.apk`;
149 - const notes = [
150 - `T3 Code for Android that works with nightly servers, mirrored from the Google Play ${trackName} track. Current build: ${build.versionName} (${build.versionCode}).`,
151 - "",
152 - "The Play Store release can't connect to a nightly server yet. Install this APK if you can't join the Play testing group. Only the newest build is kept here.",
153 - ].join("\n");
154 -
155 - const release = readRelease(tag);
141 + let release = readRelease(tag);
142 const assets = release?.assets ?? [];
157 - // A failed upload can leave an empty asset under the final name.
158 - const published = assets.some(
159 - (asset) => asset.name === apkName && asset.state === "uploaded" && asset.size > 0,
160 - );
161 - if (published) {
162 - console.log(`${apkName} is already published.`);
163 - } else if (await uploadApk({ token, appUrl, build, tag, apkName, notes, release })) {
164 - console.log(`Published ${apkName}.`);
165 - summary(`:white_check_mark: Published \`${apkName}\` to the \`${tag}\` release.`);
166 - } else {
167 - // The next run retries.
168 - console.log(`Play lists no universal APK for ${build.versionCode}.`);
169 - summary(
170 - `:hourglass: Play lists no universal APK for ${build.versionName} (${build.versionCode}).`,
143 + const sections = [];
144 + for (const { track, channel, label, stability } of [
145 + {
146 + track: "alpha",
147 + channel: "beta",
148 + label: "Beta",
149 + stability:
150 + "Promoted for wider testing. Recommended over internal builds, but may still contain bugs.",
151 + },
152 + {
153 + track: "internal",
154 + channel: "internal",
155 + label: "Internal",
156 + stability: "Newest, less-tested builds. May contain serious bugs.",
157 + },
158 + ]) {
159 + const prefix = `t3code-android-${channel}-`;
160 + let available = assets.filter(
161 + (asset) => asset.name.startsWith(prefix) && asset.state === "uploaded" && asset.size > 0,
162 );
172 - return;
173 - }
174 -
175 - // Reconciled on every run so an interrupted cleanup finishes on the next one.
176 - for (const stale of assets) {
177 - if (stale.name.endsWith(".apk") && stale.name !== apkName) {
178 - gh("release", "delete-asset", tag, stale.name, "--yes");
163 + const build = await newestTrackBuild(token, appUrl, track);
164 + if (build) {
165 + const safeName = build.versionName.replace(/[^0-9A-Za-z.]+/g, "-").replace(/^-|-$/g, "");
166 + const apkName = `${prefix}${safeName}-${build.versionCode}.apk`;
167 + const published = assets.some(
168 + (asset) => asset.name === apkName && asset.state === "uploaded" && asset.size > 0,
169 + );
170 + if (
171 + published ||
172 + (await uploadApk({
173 + token,
174 + appUrl,
175 + build,
176 + tag,
177 + apkName,
178 + notes: "Android testing APKs. Release notes are being updated.",
179 + title,
180 + release,
181 + }))
182 + ) {
183 + release ??= { assets: [], body: "" };
184 + available = [{ name: apkName }];
185 + summary(`Published or verified \`${apkName}\` on \`${tag}\`.`);
186 + // Clean up only this track after its replacement is available. Retire
187 + // the legacy unlabelled APK when the beta replacement is published.
188 + for (const stale of assets) {
189 + const belongsToTrack =
190 + stale.name.startsWith(prefix) ||
191 + (track === "alpha" && /^t3code-android-(?!beta-|internal-).*\.apk$/.test(stale.name));
192 + if (belongsToTrack && stale.name.endsWith(".apk") && stale.name !== apkName) {
193 + gh("release", "delete-asset", tag, stale.name, "--yes");
194 + }
195 + }
196 + } else {
197 + summary(
198 + `Play is still processing the ${track} APK for ${build.versionCode}; keeping the previous download.`,
199 + );
200 + }
201 }
202 + sections.push(
203 + `## ${label}`,
204 + "",
205 + stability,
206 + "",
207 + ...available.map(
208 + (asset) =>
209 + `- [${asset.name}](https://github.com/${requireEnv("GH_REPO")}/releases/download/${tag}/${asset.name})`,
210 + ),
211 + ...(available.length ? [] : ["No APK available yet."]),
212 + "",
213 + );
214 }
181 - if (release && release.body.replace(/\r\n/g, "\n").trim() !== notes) {
182 - gh("release", "edit", tag, "--notes", notes);
215 + if (!release) return;
216 + const notes = [
217 + "T3 Code Android APKs mirrored from Google Play. Only the newest available APK from each track is kept here.",
218 + "",
219 + ...sections,
220 + ]
221 + .join("\n")
222 + .trim();
223 + if (release.body.replace(/\r\n/g, "\n").trim() !== notes) {
224 + gh("release", "edit", tag, "--title", title, "--notes", notes);
225 }
226 }
227
.github/workflows/mobile-android-apk.yml
+3 -7
@@ -1,7 +1,7 @@
1 name: Mobile Android APK
2
3 -# Publishes the newest nightly-compatible Android build as a sideloadable APK
4 -# on the rolling "android-nightly" prerelease, for nightly users who can't join
3 +# Publishes the newest Alpha and internal-testing Android builds as a sideloadable APK
4 +# on the rolling "android-nightly" prerelease for users who can't join
5 # the Play testing group. Play re-signs uploaded bundles with the app signing
6 # key, so its universal APK matches the Play Store install and needs no signing
7 # secrets here. EAS submits asynchronously (--no-wait), so this polls Play
@@ -19,17 +19,13 @@ concurrency:
19
20 jobs:
21 mirror:
22 - name: Mirror Play APK
22 + name: Mirror Play APKs
23 runs-on: blacksmith-2vcpu-ubuntu-2404
24 timeout-minutes: 10
25 permissions:
26 contents: write
27 env:
28 PACKAGE_NAME: com.t3tools.t3code
29 - # eas.json submits v2-preview builds to this closed testing track; they
30 - # speak the orchestration protocol nightly servers use, which the Play
31 - # Store release can't.
32 - PLAY_TRACK: v2
29 RELEASE_TAG: android-nightly
30 steps:
31 - id: credentials
.github/workflows/mobile-eas-production.yml
+1 -21
@@ -15,9 +15,6 @@ name: Mobile EAS Production
15 # batch to avoid a store build per PR.
16 # workflow_dispatch remains as a manual override for both modes (e.g. to
17 # retry an errored build or force an OTA).
18 -# Manual v2-preview builds keep the production app identity and disable OTA.
19 -# They auto-submit to TestFlight and the Google Play closed testing track v2.
20 -# Select the v2 branch when dispatching a preview build.
18 on:
19 workflow_dispatch:
20 inputs:
@@ -30,14 +27,13 @@ on:
27 - build
28 - update
29 profile:
33 - description: "production: store release; testflight: iOS 3.0.0 beta; v2-preview: legacy closed testing"
30 + description: "production: store release; testflight: iOS 3.0.0 beta"
31 required: true
32 type: choice
33 default: production
34 options:
35 - production
36 - testflight
40 - - v2-preview
37 platform:
38 description: "Target platform"
39 required: true
@@ -86,12 +82,6 @@ jobs:
82 APP_VARIANT: production
83 NODE_OPTIONS: --max-old-space-size=8192
84 steps:
89 - - name: Reject preview OTA updates
90 - if: github.event_name == 'workflow_dispatch' && inputs.profile == 'v2-preview' && inputs.mode == 'update'
91 - run: |
92 - echo "::error::V2 previews use store builds only. Select mode=build."
93 - exit 1
94 -
85 - name: Validate TestFlight inputs
86 if: github.event_name == 'workflow_dispatch' && inputs.profile == 'testflight'
87 env:
@@ -145,16 +135,6 @@ jobs:
135 args:
136 - --filter=@t3tools/mobile...
137
148 - - name: Verify v2 preview source
149 - if: steps.expo-token.outputs.present == 'true' && github.event_name == 'workflow_dispatch' && inputs.profile == 'v2-preview'
150 - run: |
151 - node --input-type=module -e '
152 - import * as environment from "./packages/contracts/src/environment.ts";
153 - if (environment.ORCHESTRATION_PROTOCOL_VERSION !== 2) {
154 - throw new Error("V2 previews require a v2 source branch. Select the v2 branch when running this workflow.");
155 - }
156 - '
157 -
138 - name: Expose pnpm
139 if: steps.expo-token.outputs.present == 'true'
140 run: |
apps/mobile/eas.json
-15
@@ -55,14 +55,6 @@
55 "T3CODE_MOBILE_VERSION": "3.0.0"
56 }
57 },
58 - "v2-preview": {
59 - "extends": "production",
60 - "distribution": "store",
61 - "channel": "v2-preview",
62 - "env": {
63 - "T3CODE_MOBILE_UPDATES_ENABLED": "0"
64 - }
65 - },
58 "production": {
59 "corepack": true,
60 "env": {
@@ -81,13 +73,6 @@
73 "testflight": {
74 "extends": "production"
75 },
84 - "v2-preview": {
85 - "extends": "production",
86 - "android": {
87 - "track": "v2",
88 - "releaseStatus": "completed"
89 - }
90 - },
76 "production": {
77 "ios": {
78 "ascAppId": "6787819824"
docs/operations/release.md
+9 -3
@@ -321,9 +321,15 @@ unreleased major and get its first beta build approved.
321 ## Android APK mirror
322
323 `.github/workflows/mobile-android-apk.yml` checks Google Play hourly and publishes the newest
324 -build on the `v2` closed testing track to the rolling `android-nightly` prerelease, for nightly
325 -users who can't join the Play testing group. Those v2-preview builds are the only Android builds that can
326 -connect to a nightly server. The APK is the universal APK Play generates and signs from the
324 +builds on two tracks for users who can't join the Play testing group:
325 +
326 +- `beta` follows Alpha closed testing, with builds promoted for wider testing.
327 +- `internal` follows internal testing, with newer, less-tested builds.
328 +
329 +Both APKs live in the `android-nightly` release, with `beta` or `internal` in each filename.
330 +Release notes describe their stability and link to each download. The mirror keeps only
331 +the newest available APK per track. Android submissions
332 +go to internal testing; the Alpha mirror updates after promotion to Alpha. The APK is the universal APK Play generates and signs from the
333 uploaded bundle, so no signing key lives in GitHub. The job skips itself until
334 `GOOGLE_PLAY_SERVICE_ACCOUNT_JSON` holds a Play service account key with the "Release to
335 production, exclude devices, and use Play App Signing" permission, which downloading generated