File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9494 sudo apt-get update
9595 sudo apt-get install -y libarchive-tools rpm
9696
97+ - name : Write .env file
98+ run : printenv ENV_FILE > apps/desktop/.env
99+ env :
100+ ENV_FILE : ${{ secrets.ENV_FILE }}
101+
97102 - name : Build desktop app
98103 run : pnpm --filter @pairux/desktop build
99104 env :
@@ -109,11 +114,6 @@ jobs:
109114 # Windows signing
110115 WINDOWS_CERTIFICATE_PASSWORD : ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
111116
112- - name : Write .env file
113- run : printenv ENV_FILE > apps/desktop/.env
114- env :
115- ENV_FILE : ${{ secrets.ENV_FILE }}
116-
117117 - name : Package desktop app
118118 working-directory : apps/desktop
119119 run : npx electron-builder --${{ matrix.platform }} --${{ matrix.arch }} --publish never
Original file line number Diff line number Diff line change @@ -20,8 +20,6 @@ extraResources:
2020 to : icons
2121 filter :
2222 - ' **/*'
23- - from : .env
24- to : .env
2523
2624asar : true
2725asarUnpack :
Original file line number Diff line number Diff line change 11import { defineConfig , externalizeDepsPlugin } from 'electron-vite' ;
22import react from '@vitejs/plugin-react' ;
33import { resolve } from 'path' ;
4+ import { config } from 'dotenv' ;
5+
6+ // Load .env so build-time values can be injected via `define`
7+ config ( ) ;
48
59export default defineConfig ( {
610 main : {
@@ -42,5 +46,10 @@ export default defineConfig({
4246 '@' : resolve ( __dirname , 'src/renderer' ) ,
4347 } ,
4448 } ,
49+ define : {
50+ 'process.env.NEXT_PUBLIC_LIVEKIT_URL' : JSON . stringify (
51+ process . env . NEXT_PUBLIC_LIVEKIT_URL ?? ''
52+ ) ,
53+ } ,
4554 } ,
4655} ) ;
Original file line number Diff line number Diff line change @@ -11,13 +11,11 @@ import { setMainWindow as setStreamingMainWindow } from './streaming';
1111// Must match the .desktop file name (pairux.desktop) and electron-builder executableName.
1212app . setName ( 'pairux' ) ;
1313
14- // Load environment variables from .env file
15- // In dev: __dirname is dist/main, so go up 2 levels to apps/desktop/.env (symlink to root)
16- // In prod: extraResources places .env in the resources directory
17- const envPath = app . isPackaged
18- ? resolve ( process . resourcesPath , '.env' )
19- : resolve ( __dirname , '../../.env' ) ;
20- config ( { path : envPath } ) ;
14+ // Load environment variables from .env file in development only.
15+ // In production, env vars are injected at build time by electron-vite.
16+ if ( ! app . isPackaged ) {
17+ config ( { path : resolve ( __dirname , '../../.env' ) } ) ;
18+ }
2119
2220// Detect display server (X11 vs Wayland)
2321const isWayland =
You can’t perform that action at this time.
0 commit comments