Skip to content

Commit a77e27c

Browse files
authored
Merge branch 'main' into settings-history-swipe-navigation
2 parents b34f789 + 1d78b33 commit a77e27c

1,222 files changed

Lines changed: 61796 additions & 12360 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/SECURITY.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Security policy
22

33
Report security vulnerabilities affecting T3 Code or T3 Tools-operated infrastructure to
4-
[security@ping.gg](mailto:security@ping.gg). Please do not disclose them publicly until we have had
4+
[security@t3.codes](mailto:security@t3.codes). Please do not disclose them publicly until we have had
55
a reasonable opportunity to investigate and remediate them.
66

77
See the [full security policy](https://t3.codes/security-policy) for reporting details, scope,

‎.github/actions/setup-ci-deps/action.yml‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ inputs:
1313
description: Arguments for `vp install`, such as filters. Empty installs the whole workspace.
1414
required: false
1515
default: ""
16+
save-pnpm-store:
17+
description: Set to "false" when a concurrent job with the same install args saves the pnpm store
18+
required: false
19+
default: "true"
1620
runs:
1721
using: composite
1822
steps:
@@ -123,10 +127,14 @@ runs:
123127
key: ${{ steps.pnpm_verified.outputs.cache-primary-key }}
124128

125129
# A filtered install that started from the current full store adds nothing
126-
# worth a second copy of it.
130+
# worth a second copy of it. A stacked PR, based on a branch other than the
131+
# default, saves a ~1 GB store only its own reruns can read, so it only restores.
132+
# Concurrent jobs with the same install args reserve one key, so the losers
133+
# compress the store for nothing; all but one pass save-pnpm-store: false.
127134
- name: Save pnpm store
128135
if: >-
129-
inputs.install == 'true' &&
136+
inputs.install == 'true' && inputs.save-pnpm-store == 'true' &&
137+
(github.event_name != 'pull_request' || github.base_ref == github.event.repository.default_branch) &&
130138
steps.pnpm_cache.outputs.cache-hit != 'true' &&
131139
(steps.pnpm_store.outputs.namespace == 'full' ||
132140
steps.pnpm_cache.outputs.cache-matched-key != format('pnpm-full-v1-{0}-{1}-{2}', runner.os, runner.arch, hashFiles('pnpm-lock.yaml', 'pnpm-workspace.yaml', 'package.json')))

‎.github/workflows/ci.yml‎

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,41 @@ jobs:
192192
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
193193
run: node apps/desktop/scripts/verify-preload-bundle.mjs
194194

195+
# Browser tests run source modules; this boots the production chunk graph. The
196+
# desktop build above already produced apps/web/dist, and the client waits about
197+
# 15s for a session that never comes, so this runs here instead of in Test Web,
198+
# which gates the whole run. Chromium comes from the cache Test Web shares.
199+
- name: Resolve Playwright version
200+
id: playwright_version
201+
if: ${{ !cancelled() && steps.build.outcome == 'success' && needs.changes.outputs.test_web != 'false' }}
202+
run: echo "version=$(node -p "require('./apps/web/node_modules/playwright/package.json').version")" >> "$GITHUB_OUTPUT"
203+
204+
- name: Cache Chromium
205+
id: chromium_cache
206+
if: ${{ !cancelled() && steps.build.outcome == 'success' && needs.changes.outputs.test_web != 'false' }}
207+
uses: actions/cache@v6
208+
with:
209+
path: ~/.cache/ms-playwright
210+
key: playwright-chromium-shell-${{ runner.os }}-${{ runner.arch }}-${{ steps.playwright_version.outputs.version }}
211+
212+
- name: Install Chromium for the built web client boot check
213+
if: ${{ !cancelled() && steps.build.outcome == 'success' && needs.changes.outputs.test_web != 'false' && steps.chromium_cache.outputs.cache-hit != 'true' }}
214+
run: node apps/web/node_modules/playwright/cli.js install --only-shell chromium
215+
216+
- name: Install missing Chromium system dependencies
217+
if: ${{ !cancelled() && steps.build.outcome == 'success' && needs.changes.outputs.test_web != 'false' }}
218+
run: |
219+
browser=$(find "$HOME/.cache/ms-playwright" -name chrome-headless-shell -type f -print -quit)
220+
test -n "$browser"
221+
if ldd "$browser" | grep '=> not found'; then
222+
node apps/web/node_modules/playwright/cli.js install-deps chromium
223+
fi
224+
225+
- name: Boot the built web client
226+
if: ${{ !cancelled() && steps.build.outcome == 'success' && needs.changes.outputs.test_web != 'false' }}
227+
timeout-minutes: 3
228+
run: node apps/web/scripts/verify-built-boot.ts
229+
195230
- name: Typecheck
196231
if: ${{ !cancelled() && steps.typecheck.outcome == 'success' }}
197232
timeout-minutes: 5
@@ -340,12 +375,6 @@ jobs:
340375
- name: Test
341376
run: vp run --filter @t3tools/web test
342377

343-
# Browser tests run source modules; this boots the production chunk graph.
344-
- name: Boot the built web client
345-
run: |
346-
vp run --filter @t3tools/web build
347-
node apps/web/scripts/verify-built-boot.ts
348-
349378
# apps/server sets `fileParallelism: false`, so its test files run strictly
350379
# one at a time. Sharding spreads them over separate runners instead of
351380
# separate workers, so no two server test files ever share a machine and the

‎.github/workflows/desktop-macos-preview.yml‎

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,27 @@ jobs:
7373
# Public T3 Connect identifiers (Clerk publishable key, relay URL).
7474
cp .env.example .env
7575
76-
- uses: ./.github/actions/setup-apt-mirrors
76+
# PR heads from before build:desktop:bundle use the full build, which
77+
# compiles the Linux browser secret helper and needs libsecret.
78+
- name: Check bundle-only build support
79+
id: bundle_build
80+
run: |
81+
script="$(node -p "require('./package.json').scripts['build:desktop:bundle'] ? 'build:desktop:bundle' : 'build:desktop'")"
82+
echo "script=$script" >> "$GITHUB_OUTPUT"
83+
84+
- if: steps.bundle_build.outputs.script == 'build:desktop'
85+
uses: ./.github/actions/setup-apt-mirrors
7786

7887
- name: Install browser secret helper build libraries
88+
if: steps.bundle_build.outputs.script == 'build:desktop'
7989
run: sudo apt-get update && sudo apt-get install -y libsecret-1-dev pkg-config
8090

81-
# desktop-macos-preview-publish.yml packages this bundle as the preview channel.
91+
# desktop-macos-preview-publish.yml packages this bundle as the preview
92+
# channel. The Linux browser secret helper is not part of a macOS app.
8293
- name: Build JS bundle
8394
env:
8495
T3CODE_TELEMETRY_CHANNEL: ${{ github.repository == 'pingdotgg/t3code' && 'preview' || 'dev' }}
85-
run: vp run build:desktop
96+
run: vp run ${{ steps.bundle_build.outputs.script }}
8697

8798
# Same layout as release.yml's js-bundle so release-desktop.yml can
8899
# package it unchanged.

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

Lines changed: 65 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ on:
7777
required: false
7878
default: ""
7979
type: string
80+
# Whether this job saves the workspace pnpm store. Release's two Macs
81+
# install the same store on the same runner type, so only one saves it.
82+
save_pnpm_store:
83+
required: false
84+
default: true
85+
type: boolean
8086
version:
8187
required: true
8288
type: string
@@ -160,6 +166,7 @@ jobs:
160166
uses: ./.github/actions/setup-ci-deps
161167
with:
162168
install-args: --filter=@t3tools/desktop... --filter=t3... --filter=@t3tools/scripts...
169+
save-pnpm-store: ${{ inputs.save_pnpm_store }}
163170
env:
164171
pnpm_config_cache_dir: ${{ runner.temp }}/pnpm-metadata
165172

@@ -408,6 +415,7 @@ jobs:
408415
run: command -v patchelf || { sudo apt-get update && sudo apt-get install -y patchelf; }
409416

410417
- name: Build CLI archive
418+
id: build_cli
411419
if: inputs.cli_archive
412420
shell: bash
413421
env:
@@ -425,37 +433,52 @@ jobs:
425433
AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME }}
426434
run: |
427435
set -euo pipefail
428-
if [[ "${{ inputs.platform }}" == "mac" && -n "${APPLE_API_KEY:-}" ]]; then
429-
key_path="$RUNNER_TEMP/AuthKey_cli_${APPLE_API_KEY_ID}.p8"
430-
printf '%s' "$APPLE_API_KEY" > "$key_path"
431-
export APPLE_API_KEY="$key_path"
436+
extra_args=()
437+
if [[ "${{ inputs.platform }}" == "mac" ]]; then
438+
if [[ -n "${APPLE_API_KEY:-}" ]]; then
439+
key_dir="$(mktemp -d "$RUNNER_TEMP/t3-cli-notary.XXXXXXXX")"
440+
trap 'rm -rf "$key_dir"' EXIT
441+
key_path="$key_dir/AuthKey.p8"
442+
(umask 077 && printf '%s' "$APPLE_API_KEY" > "$key_path")
443+
export APPLE_API_KEY="$key_path"
444+
fi
445+
# Older release refs lack deferred notarization and still wait here.
446+
cli_help="$(node scripts/build-cli-archive.ts --help)"
447+
if [[ "$cli_help" == *--notary-submission-file* ]]; then
448+
extra_args=(--notary-submission-file "$RUNNER_TEMP/t3-cli-notary-submission")
449+
echo "deferred_notarization=true" >> "$GITHUB_OUTPUT"
450+
fi
432451
fi
433452
node scripts/build-cli-archive.ts \
434453
--platform "${{ inputs.platform }}" \
435454
--arch "${{ inputs.arch }}" \
436455
--version "${{ inputs.version }}" \
437456
--resource-monitor-dir "$RUNNER_TEMP/cli-resource-monitor" \
438-
--output-dir release-cli
457+
--output-dir release-cli \
458+
${extra_args[@]+"${extra_args[@]}"}
439459
440460
- name: Smoke-test CLI archive
441461
if: inputs.cli_archive && inputs.verify_runner == ''
442462
shell: bash
443463
run: node scripts/smoke-cli-archive.ts --archive release-cli/* --expect-version "${{ inputs.version }}"
444464

465+
# macOS uploads its archive after "Await CLI notarization" instead.
445466
- name: Upload CLI archive
446-
if: inputs.cli_archive
467+
if: inputs.cli_archive && inputs.platform != 'mac'
447468
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
448469
with:
449470
name: cli-${{ inputs.platform }}-${{ inputs.arch }}
450471
path: release-cli/*
451472
if-no-files-found: error
473+
# The archive is already gzip or zip; deflating it again saves under 2%.
474+
compression-level: 0
452475

453476
- name: Install Linux desktop build libraries
454477
if: inputs.platform == 'linux'
455478
shell: bash
456479
run: |
457480
sudo apt-get update
458-
sudo apt-get install -y libsecret-1-dev pkg-config
481+
sudo apt-get install -y libsecret-1-dev pkg-config libgtk-3-0t64 libnss3 libasound2t64 libgbm1
459482
if ! command -v magick >/dev/null 2>&1 && ! command -v convert >/dev/null 2>&1; then
460483
sudo apt-get install -y imagemagick
461484
fi
@@ -618,6 +641,39 @@ jobs:
618641
619642
vp run dist:desktop:artifact "${args[@]}"
620643
644+
# The CLI was submitted without waiting so Apple reviews it while the
645+
# desktop builds. Notarization does not change the archive bytes, but
646+
# nothing uploads them, so nothing publishes them, until Apple accepts.
647+
# With signing configured, a missing submission id fails this step.
648+
- name: Await CLI notarization
649+
if: inputs.cli_archive && inputs.platform == 'mac' && steps.build_cli.outputs.deferred_notarization == 'true'
650+
shell: bash
651+
env:
652+
APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
653+
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
654+
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
655+
run: |
656+
set -euo pipefail
657+
if [[ -n "${APPLE_API_KEY:-}" ]]; then
658+
key_dir="$(mktemp -d "$RUNNER_TEMP/t3-cli-notary.XXXXXXXX")"
659+
trap 'rm -rf "$key_dir"' EXIT
660+
key_path="$key_dir/AuthKey.p8"
661+
(umask 077 && printf '%s' "$APPLE_API_KEY" > "$key_path")
662+
export APPLE_API_KEY="$key_path"
663+
fi
664+
node scripts/build-cli-archive.ts await-notarization \
665+
--submission-file "$RUNNER_TEMP/t3-cli-notary-submission"
666+
667+
- name: Upload notarized CLI archive
668+
if: inputs.cli_archive && inputs.platform == 'mac'
669+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
670+
with:
671+
name: cli-${{ inputs.platform }}-${{ inputs.arch }}
672+
path: release-cli/*
673+
if-no-files-found: error
674+
# The archive is already gzip or zip; deflating it again saves under 2%.
675+
compression-level: 0
676+
621677
# Warm installs only touch the store index, so new content means a fetch.
622678
- name: Check staged install cache for new content
623679
id: stage_pnpm_changed
@@ -761,6 +817,8 @@ jobs:
761817
name: desktop-${{ inputs.platform }}-${{ inputs.arch }}
762818
path: release-publish/*
763819
if-no-files-found: error
820+
# Installers, zips and blockmaps are already compressed; deflating them again saves under 0.3%.
821+
compression-level: 0
764822

765823
- name: Upload resource monitor
766824
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7

0 commit comments

Comments
 (0)