TypeScript
ci(release): JS bundle jobs stop building an unused Linux helper (#31941)
Theo Browne8344de78eb5e
diff --git a/.github/workflows/desktop-macos-preview.yml b/.github/workflows/desktop-macos-preview.ymlindex 6dcdd702c2d..0213f3fce6a 100644--- a/.github/workflows/desktop-macos-preview.yml+++ b/.github/workflows/desktop-macos-preview.yml@@ -73,16 +73,27 @@ jobs:# Public T3 Connect identifiers (Clerk publishable key, relay URL).cp .env.example .env- - uses: ./.github/actions/setup-apt-mirrors+ # PR heads from before build:desktop:bundle use the full build, which+ # compiles the Linux browser secret helper and needs libsecret.+ - name: Check bundle-only build support+ id: bundle_build+ run: |+ script="$(node -p "require('./package.json').scripts['build:desktop:bundle'] ? 'build:desktop:bundle' : 'build:desktop'")"+ echo "script=$script" >> "$GITHUB_OUTPUT"++ - if: steps.bundle_build.outputs.script == 'build:desktop'+ uses: ./.github/actions/setup-apt-mirrors- name: Install browser secret helper build libraries+ if: steps.bundle_build.outputs.script == 'build:desktop'run: sudo apt-get update && sudo apt-get install -y libsecret-1-dev pkg-config- # desktop-macos-preview-publish.yml packages this bundle as the preview channel.+ # desktop-macos-preview-publish.yml packages this bundle as the preview+ # channel. The Linux browser secret helper is not part of a macOS app.- name: Build JS bundleenv:T3CODE_TELEMETRY_CHANNEL: ${{ github.repository == 'pingdotgg/t3code' && 'preview' || 'dev' }}- run: vp run build:desktop+ run: vp run ${{ steps.bundle_build.outputs.script }}# Same layout as release.yml's js-bundle so release-desktop.yml can# package it unchanged.diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex 82f39f8034c..9c3c5949723 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -565,22 +565,32 @@ jobs:- name: Align package versions to release versionrun: node scripts/update-release-package-versions.ts "${{ needs.preflight.outputs.version }}"- - uses: ./.github/actions/setup-apt-mirrors+ # Older release refs lack build:desktop:bundle and use the full build,+ # which compiles the Linux browser secret helper and needs libsecret.+ - name: Check bundle-only build support+ id: bundle_build+ run: |+ script="$(node -p "require('./package.json').scripts['build:desktop:bundle'] ? 'build:desktop:bundle' : 'build:desktop'")"+ echo "script=$script" >> "$GITHUB_OUTPUT"++ - if: steps.bundle_build.outputs.script == 'build:desktop'+ uses: ./.github/actions/setup-apt-mirrors- # @t3tools/desktop#build compiles the Linux browser secret helper on a- # Linux host before packing, and that needs libsecret headers.- name: Install browser secret helper build libraries+ if: steps.bundle_build.outputs.script == 'build:desktop'run: sudo apt-get update && sudo apt-get install -y libsecret-1-dev pkg-config- # Runs t3#build (which depends on @t3tools/web#build) and- # @t3tools/desktop#build, so apps/server/dist holds the server bundle- # plus the web client and apps/desktop/dist-electron the Electron main.+ # Runs t3#build (which depends on @t3tools/web#build) and the desktop+ # bundle, so apps/server/dist holds the server bundle plus the web client+ # and apps/desktop/dist-electron the Electron main. build:desktop:bundle+ # skips the Linux browser secret helper, which this artifact does not+ # carry; each Linux package job compiles its own per arch.# The release channel is already stable, nightly, or preview. Builds in# other repositories report "dev" telemetry.- name: Build JS bundleenv:T3CODE_TELEMETRY_CHANNEL: ${{ github.repository == 'pingdotgg/t3code' && needs.preflight.outputs.release_channel || 'dev' }}- run: vp run build:desktop+ run: vp run ${{ steps.bundle_build.outputs.script }}# Two paths under apps/ so the artifact root is apps/; consumers download# into `apps` to restore both at their original locations.diff --git a/apps/desktop/vite.config.ts b/apps/desktop/vite.config.tsindex d06efd4d9d7..ba375768150 100644--- a/apps/desktop/vite.config.ts+++ b/apps/desktop/vite.config.ts@@ -25,6 +25,12 @@ export default defineConfig({dependsOn: ["t3#build"],cache: false,},+ // CI bundle jobs skip the Linux browser secret helper; packaging stages one per arch.+ "build:bundle": {+ command: "node scripts/build-preview-annotation-css.mjs && vp pack",+ dependsOn: ["t3#build"],+ cache: false,+ },dev: {command:"node scripts/build-browser-secret.mjs && node scripts/build-preview-annotation-css.mjs && cross-env T3CODE_DESKTOP_DEV=1 vp pack --watch",diff --git a/package.json b/package.jsonindex f6731683bbc..0664806c3ad 100644--- a/package.json+++ b/package.json@@ -24,6 +24,7 @@"build": "vp run --filter './apps/*' build","build:marketing": "vp run --filter @t3tools/marketing build","build:desktop": "vp run --filter @t3tools/desktop --filter t3 build",+ "build:desktop:bundle": "vp run --filter @t3tools/desktop build:bundle","build:resource-monitor": "cargo build --locked --release --manifest-path native/resource-monitor/Cargo.toml","typecheck": "vp run -r --cache --concurrency-limit 4 typecheck","tc": "vp run -r --cache --concurrency-limit 4 typecheck",