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