@@ -297,6 +297,10 @@ jobs:
297297 sudo sed -i 's|http://|https://|g' /etc/apt/blacksmith-ubuntu-mirrors.txt /etc/apt/sources.list.d/ubuntu.sources
298298 sudo apt-get update && sudo apt-get install -y libsecret-1-dev pkg-config build-essential
299299
300+ # The web package's browser project runs React tests in headless Chromium.
301+ - name : Install Chromium for web browser tests
302+ run : node apps/web/node_modules/playwright/cli.js install --with-deps --only-shell chromium
303+
300304 - name : Test
301305 run : vp run --parallel --concurrency-limit 4 --filter '!t3' --filter '!@t3tools/monorepo' test
302306
@@ -521,7 +525,11 @@ jobs:
521525 # Runs t3#build (which depends on @t3tools/web#build) and
522526 # @t3tools/desktop#build, so apps/server/dist holds the server bundle
523527 # plus the web client and apps/desktop/dist-electron the Electron main.
528+ # The release channel is already stable, nightly, or preview. Builds in
529+ # other repositories report "dev" telemetry.
524530 - name : Build JS bundle
531+ env :
532+ T3CODE_TELEMETRY_CHANNEL : ${{ github.repository == 'pingdotgg/t3code' && needs.preflight.outputs.release_channel || 'dev' }}
525533 run : vp run build:desktop
526534
527535 # Two paths under apps/ so the artifact root is apps/; consumers download
@@ -689,11 +697,8 @@ jobs:
689697 resource_key : win32-arm64
690698 cli_archive : true
691699
692- # npm gets the same bytes as the GitHub Release: the launcher plus one
693- # package per CLI archive. Preview publishes too, under the `preview`
694- # dist-tag, which nothing resolves unless asked for by name.
695- publish_cli :
696- name : Publish CLI to npm
700+ release :
701+ name : Publish GitHub Release
697702 needs :
698703 [
699704 preflight,
@@ -702,74 +707,13 @@ jobs:
702707 test,
703708 test_server,
704709 desktop_mac_arm64,
705- desktop_linux_x64,
706- desktop_linux_arm64,
707- desktop_win_x64,
708- desktop_win_arm64,
709- ]
710- if : ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' && needs.quality.result == 'success' && needs.test.result == 'success' && needs.test_server.result == 'success' && needs.desktop_mac_arm64.result == 'success' && needs.desktop_linux_x64.result == 'success' && needs.desktop_linux_arm64.result == 'success' && needs.desktop_win_x64.result == 'success' && needs.desktop_win_arm64.result == 'success' }}
711- runs-on : ubuntu-24.04 # blacksmith-8vcpu-ubuntu-2404
712- timeout-minutes : 15
713- permissions :
714- contents : read
715- id-token : write
716- steps :
717- - name : Checkout
718- uses : actions/checkout@v6
719- with :
720- ref : ${{ needs.preflight.outputs.ref }}
721- sparse-checkout : |
722- /*
723- !/.repos/
724- sparse-checkout-cone-mode : false
725-
726- - name : Setup Vite+
727- uses : voidzero-dev/setup-vp@v1
728- with :
729- node-version-file : package.json
730- cache : true
731- run-install : |
732- args:
733- - --filter=t3...
734- - --filter=@t3tools/scripts...
735-
736- - name : Download all CLI archives
737- uses : actions/download-artifact@v8
738- with :
739- pattern : cli-*
740- merge-multiple : true
741- path : release-cli
742-
743- - name : Build npm packages from CLI archives
744- run : node scripts/build-npm-platform-packages.ts --archives-dir release-cli --version "${{ needs.preflight.outputs.version }}" --output-dir npm-packages
745-
746- # A dry run of every package first: an auth or scope error here (the
747- # @t3code org missing, a package without a trusted publisher) fails
748- # before anything is live, instead of after some platforms already are.
749- - name : Check npm publish access (dry run)
750- run : |
751- if ! node apps/server/scripts/cli.ts publish --packages-dir npm-packages --tag "${{ needs.preflight.outputs.cli_dist_tag }}" --provenance --dry-run --verbose; then
752- echo "::error::npm publish --dry-run failed. Make sure the @t3code npm org exists and that t3 and every @t3code/t3-<platform> package has a trusted publisher registered for .github/workflows/release.yml (see docs/operations/release.md)." >&2
753- exit 1
754- fi
755-
756- - name : Publish CLI packages
757- run : node apps/server/scripts/cli.ts publish --packages-dir npm-packages --tag "${{ needs.preflight.outputs.cli_dist_tag }}" --provenance --verbose
758-
759- release :
760- name : Publish GitHub Release
761- needs :
762- [
763- preflight,
764- desktop_mac_arm64,
765710 desktop_mac_x64,
766711 desktop_linux_x64,
767712 desktop_linux_arm64,
768713 desktop_win_x64,
769714 desktop_win_arm64,
770- publish_cli,
771715 ]
772- if : ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.desktop_mac_arm64 .result == 'success' && needs.desktop_mac_x64 .result == 'success' && needs.desktop_linux_x64 .result == 'success' && needs.desktop_linux_arm64 .result == 'success' && needs.desktop_win_x64 .result == 'success' && needs.desktop_win_arm64 .result == 'success' && needs.publish_cli .result == 'success' }}
716+ if : ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.relay_public_config .result == 'success' && needs.quality .result == 'success' && needs.test .result == 'success' && needs.test_server .result == 'success' && needs.desktop_mac_arm64 .result == 'success' && needs.desktop_mac_x64 .result == 'success' && needs.desktop_linux_x64.result == 'success' && needs.desktop_linux_arm64.result == 'success' && needs.desktop_win_x64.result == 'success' && needs.desktop_win_arm64 .result == 'success' }}
773717 runs-on : blacksmith-8vcpu-ubuntu-2404
774718 timeout-minutes : 30
775719 permissions :
@@ -957,6 +901,49 @@ jobs:
957901 fail_on_unmatched_files : true
958902 token : ${{ github.token }}
959903
904+ # The `t3` npm package is a launcher that downloads this version's CLI
905+ # archive from the GitHub Release, so it publishes only once that release
906+ # exists. Preview publishes too, under the `preview` dist-tag, which
907+ # nothing resolves unless asked for by name.
908+ publish_cli :
909+ name : Publish CLI to npm
910+ needs : [preflight, release]
911+ if : ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.release.result == 'success' }}
912+ runs-on : ubuntu-24.04 # blacksmith-8vcpu-ubuntu-2404
913+ timeout-minutes : 15
914+ permissions :
915+ contents : read
916+ id-token : write
917+ steps :
918+ - name : Checkout
919+ uses : actions/checkout@v6
920+ with :
921+ ref : ${{ needs.preflight.outputs.ref }}
922+ sparse-checkout : |
923+ /*
924+ !/.repos/
925+ sparse-checkout-cone-mode : false
926+
927+ - name : Setup Vite+
928+ uses : voidzero-dev/setup-vp@v1
929+ with :
930+ node-version-file : package.json
931+ cache : true
932+ run-install : |
933+ args:
934+ - --filter=t3...
935+ - --filter=@t3tools/scripts...
936+
937+ - name : Build the npm launcher
938+ run : node scripts/build-npm-launcher.ts --version "${{ needs.preflight.outputs.version }}" --output-dir npm-packages
939+
940+ - name : Publish the npm launcher
941+ run : |
942+ if ! node apps/server/scripts/cli.ts publish --packages-dir npm-packages --tag "${{ needs.preflight.outputs.cli_dist_tag }}" --provenance --verbose; then
943+ echo "::error::npm publish failed. Make sure package t3 has a trusted publisher registered for .github/workflows/release.yml (see docs/operations/release.md)." >&2
944+ exit 1
945+ fi
946+
960947 publish_aur :
961948 name : Publish AUR package
962949 needs : [preflight, release]
@@ -1074,8 +1061,8 @@ jobs:
10741061
10751062 deploy_web :
10761063 name : Deploy hosted web app
1077- needs : [preflight, build_web, release]
1078- if : ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.build_web.result == 'success' && needs.release.result == 'success' && needs.preflight.outputs.release_channel != 'preview' }}
1064+ needs : [preflight, build_web, release, publish_cli ]
1065+ if : ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.build_web.result == 'success' && needs.release.result == 'success' && needs.publish_cli.result == 'success' && needs. preflight.outputs.release_channel != 'preview' }}
10791066 runs-on : blacksmith-2vcpu-ubuntu-2404
10801067 timeout-minutes : 10
10811068 env :
0 commit comments