Skip to content

Commit 006106d

Browse files
chore(sync): merge upstream main and preserve fork integrations
2 parents 8200347 + b90e554 commit 006106d

535 files changed

Lines changed: 24803 additions & 3681 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:
@@ -125,10 +129,14 @@ runs:
125129
key: ${{ steps.pnpm_verified.outputs.cache-primary-key }}
126130

127131
# A filtered install that started from the current full store adds nothing
128-
# worth a second copy of it.
132+
# worth a second copy of it. A stacked PR, based on a branch other than the
133+
# default, saves a ~1 GB store only its own reruns can read, so it only restores.
134+
# Concurrent jobs with the same install args reserve one key, so the losers
135+
# compress the store for nothing; all but one pass save-pnpm-store: false.
129136
- name: Save pnpm store
130137
if: >-
131-
inputs.install == 'true' &&
138+
inputs.install == 'true' && inputs.save-pnpm-store == 'true' &&
139+
(github.event_name != 'pull_request' || github.base_ref == github.event.repository.default_branch) &&
132140
steps.pnpm_cache.outputs.cache-hit != 'true' &&
133141
(steps.pnpm_store.outputs.namespace == 'full' ||
134142
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
@@ -208,6 +208,41 @@ jobs:
208208
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
209209
run: node apps/desktop/scripts/verify-preload-bundle.mjs
210210

211+
# Browser tests run source modules; this boots the production chunk graph. The
212+
# desktop build above already produced apps/web/dist, and the client waits about
213+
# 15s for a session that never comes, so this runs here instead of in Test Web,
214+
# which gates the whole run. Chromium comes from the cache Test Web shares.
215+
- name: Resolve Playwright version
216+
id: playwright_version
217+
if: ${{ !cancelled() && steps.build.outcome == 'success' && needs.changes.outputs.test_web != 'false' }}
218+
run: echo "version=$(node -p "require('./apps/web/node_modules/playwright/package.json').version")" >> "$GITHUB_OUTPUT"
219+
220+
- name: Cache Chromium
221+
id: chromium_cache
222+
if: ${{ !cancelled() && steps.build.outcome == 'success' && needs.changes.outputs.test_web != 'false' }}
223+
uses: actions/cache@v6
224+
with:
225+
path: ~/.cache/ms-playwright
226+
key: playwright-chromium-shell-${{ runner.os }}-${{ runner.arch }}-${{ steps.playwright_version.outputs.version }}
227+
228+
- name: Install Chromium for the built web client boot check
229+
if: ${{ !cancelled() && steps.build.outcome == 'success' && needs.changes.outputs.test_web != 'false' && steps.chromium_cache.outputs.cache-hit != 'true' }}
230+
run: node apps/web/node_modules/playwright/cli.js install --only-shell chromium
231+
232+
- name: Install missing Chromium system dependencies
233+
if: ${{ !cancelled() && steps.build.outcome == 'success' && needs.changes.outputs.test_web != 'false' }}
234+
run: |
235+
browser=$(find "$HOME/.cache/ms-playwright" -name chrome-headless-shell -type f -print -quit)
236+
test -n "$browser"
237+
if ldd "$browser" | grep '=> not found'; then
238+
node apps/web/node_modules/playwright/cli.js install-deps chromium
239+
fi
240+
241+
- name: Boot the built web client
242+
if: ${{ !cancelled() && steps.build.outcome == 'success' && needs.changes.outputs.test_web != 'false' }}
243+
timeout-minutes: 3
244+
run: node apps/web/scripts/verify-built-boot.ts
245+
211246
- name: Typecheck
212247
if: ${{ !cancelled() && steps.typecheck.outcome == 'success' }}
213248
timeout-minutes: 5
@@ -355,12 +390,6 @@ jobs:
355390
- name: Test
356391
run: vp run --filter @t3tools/web test
357392

358-
# Browser tests run source modules; this boots the production chunk graph.
359-
- name: Boot the built web client
360-
run: |
361-
vp run --filter @t3tools/web build
362-
node apps/web/scripts/verify-built-boot.ts
363-
364393
# apps/server sets `fileParallelism: false`, so its test files run strictly
365394
# one at a time. Sharding spreads them over separate runners instead of
366395
# separate workers, so no two server test files ever share a machine and the

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,19 @@ 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

8191
# desktop-macos-preview-publish.yml packages this bundle as the preview channel.
@@ -87,7 +97,7 @@ jobs:
8797
- name: Build JS bundle
8898
env:
8999
T3CODE_TELEMETRY_CHANNEL: ${{ github.repository == 'pingdotgg/t3code' && 'preview' || 'dev' }}
90-
run: vp run build:desktop
100+
run: vp run ${{ steps.bundle_build.outputs.script }}
91101

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

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

Lines changed: 64 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ on:
8181
required: false
8282
default: ""
8383
type: string
84+
# Whether this job saves the workspace pnpm store. Release's two Macs
85+
# install the same store on the same runner type, so only one saves it.
86+
save_pnpm_store:
87+
required: false
88+
default: true
89+
type: boolean
8490
version:
8591
required: true
8692
type: string
@@ -263,6 +269,7 @@ jobs:
263269
uses: ./.github/actions/setup-ci-deps
264270
with:
265271
install-args: --filter=@t3tools/desktop... --filter=t3... --filter=@t3tools/scripts...
272+
save-pnpm-store: ${{ inputs.save_pnpm_store }}
266273
env:
267274
pnpm_config_cache_dir: ${{ runner.temp }}/pnpm-metadata
268275

@@ -483,6 +490,7 @@ jobs:
483490
run: command -v patchelf || { sudo apt-get update && sudo apt-get install -y patchelf; }
484491

485492
- name: Build CLI archive
493+
id: build_cli
486494
if: inputs.cli_archive
487495
shell: bash
488496
env:
@@ -500,30 +508,45 @@ jobs:
500508
AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME }}
501509
run: |
502510
set -euo pipefail
503-
if [[ "${{ inputs.platform }}" == "mac" && -n "${APPLE_API_KEY:-}" ]]; then
504-
key_path="$RUNNER_TEMP/AuthKey_cli_${APPLE_API_KEY_ID}.p8"
505-
printf '%s' "$APPLE_API_KEY" > "$key_path"
506-
export APPLE_API_KEY="$key_path"
511+
extra_args=()
512+
if [[ "${{ inputs.platform }}" == "mac" ]]; then
513+
if [[ -n "${APPLE_API_KEY:-}" ]]; then
514+
key_dir="$(mktemp -d "$RUNNER_TEMP/t3-cli-notary.XXXXXXXX")"
515+
trap 'rm -rf "$key_dir"' EXIT
516+
key_path="$key_dir/AuthKey.p8"
517+
(umask 077 && printf '%s' "$APPLE_API_KEY" > "$key_path")
518+
export APPLE_API_KEY="$key_path"
519+
fi
520+
# Older release refs lack deferred notarization and still wait here.
521+
cli_help="$(node scripts/build-cli-archive.ts --help)"
522+
if [[ "$cli_help" == *--notary-submission-file* ]]; then
523+
extra_args=(--notary-submission-file "$RUNNER_TEMP/t3-cli-notary-submission")
524+
echo "deferred_notarization=true" >> "$GITHUB_OUTPUT"
525+
fi
507526
fi
508527
node scripts/build-cli-archive.ts \
509528
--platform "${{ inputs.platform }}" \
510529
--arch "${{ inputs.arch }}" \
511530
--version "${{ inputs.version }}" \
512531
--resource-monitor-dir "$RUNNER_TEMP/cli-resource-monitor" \
513-
--output-dir release-cli
532+
--output-dir release-cli \
533+
${extra_args[@]+"${extra_args[@]}"}
514534
515535
- name: Smoke-test CLI archive
516536
if: inputs.cli_archive && inputs.verify_runner == ''
517537
shell: bash
518538
run: node scripts/smoke-cli-archive.ts --archive release-cli/* --expect-version "${{ inputs.version }}"
519539

540+
# macOS uploads its archive after "Await CLI notarization" instead.
520541
- name: Upload CLI archive
521-
if: inputs.cli_archive
542+
if: inputs.cli_archive && inputs.platform != 'mac'
522543
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
523544
with:
524545
name: cli-${{ inputs.platform }}-${{ inputs.arch }}
525546
path: release-cli/*
526547
if-no-files-found: error
548+
# The archive is already gzip or zip; deflating it again saves under 2%.
549+
compression-level: 0
527550

528551
- name: Install Linux desktop build libraries
529552
if: inputs.platform == 'linux'
@@ -693,6 +716,39 @@ jobs:
693716
694717
vp run dist:desktop:artifact "${args[@]}"
695718
719+
# The CLI was submitted without waiting so Apple reviews it while the
720+
# desktop builds. Notarization does not change the archive bytes, but
721+
# nothing uploads them, so nothing publishes them, until Apple accepts.
722+
# With signing configured, a missing submission id fails this step.
723+
- name: Await CLI notarization
724+
if: inputs.cli_archive && inputs.platform == 'mac' && steps.build_cli.outputs.deferred_notarization == 'true'
725+
shell: bash
726+
env:
727+
APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
728+
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
729+
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
730+
run: |
731+
set -euo pipefail
732+
if [[ -n "${APPLE_API_KEY:-}" ]]; then
733+
key_dir="$(mktemp -d "$RUNNER_TEMP/t3-cli-notary.XXXXXXXX")"
734+
trap 'rm -rf "$key_dir"' EXIT
735+
key_path="$key_dir/AuthKey.p8"
736+
(umask 077 && printf '%s' "$APPLE_API_KEY" > "$key_path")
737+
export APPLE_API_KEY="$key_path"
738+
fi
739+
node scripts/build-cli-archive.ts await-notarization \
740+
--submission-file "$RUNNER_TEMP/t3-cli-notary-submission"
741+
742+
- name: Upload notarized CLI archive
743+
if: inputs.cli_archive && inputs.platform == 'mac'
744+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
745+
with:
746+
name: cli-${{ inputs.platform }}-${{ inputs.arch }}
747+
path: release-cli/*
748+
if-no-files-found: error
749+
# The archive is already gzip or zip; deflating it again saves under 2%.
750+
compression-level: 0
751+
696752
# Warm installs only touch the store index, so new content means a fetch.
697753
- name: Check staged install cache for new content
698754
id: stage_pnpm_changed
@@ -836,6 +892,8 @@ jobs:
836892
name: desktop-${{ inputs.platform }}-${{ inputs.arch }}
837893
path: release-publish/*
838894
if-no-files-found: error
895+
# Installers, zips and blockmaps are already compressed; deflating them again saves under 0.3%.
896+
compression-level: 0
839897

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

0 commit comments

Comments
 (0)