@@ -17,72 +17,134 @@ permissions:
1717 contents : read
1818
1919jobs :
20- build :
21- name : Build (${{ matrix.os }})
22- runs-on : ${{ matrix.os }}
23- strategy :
24- fail-fast : false
25- matrix :
26- os : [ubuntu-latest, macos-latest, windows-latest]
20+ build-linux :
21+ name : Build Linux
22+ runs-on : ubuntu-latest
2723
2824 steps :
2925 - name : Checkout
3026 uses : actions/checkout@v4
3127
32- - name : Force npm to use Bash
33- if : runner.os == 'Windows'
34- run : npm config set script-shell "C:\Program Files\Git\bin\bash.exe"
35-
3628 - name : Setup Node.js
3729 uses : actions/setup-node@v4
3830 with :
3931 node-version : ' 24'
4032
41- - name : Cache npm (Linux/macOS)
42- if : runner.os != 'Windows'
33+ - name : Cache dependencies
4334 uses : actions/cache@v4
4435 with :
45- path : ~/.npm
46- key : npm-${{ runner.os }} -node-24-${{ hashFiles('package.json') }}
36+ path : node_modules
37+ key : npm-ubuntu-latest -node-24-${{ hashFiles('package.json') }}
4738 restore-keys : |
48- npm-${{ runner.os }}-node-24-
39+ npm-ubuntu-latest-node-24-
40+
41+ - name : Install dependencies
42+ run : npm install --ignore-scripts --no-audit --no-fund
4943
50- - name : Cache npm (Windows)
51- if : runner.os == 'Windows'
44+ - name : Cache Electron downloads
5245 uses : actions/cache@v4
5346 with :
54- path : ~\AppData\Local\npm-cache
55- key : npm-${{ runner.os }}-node-24-${{ hashFiles('package.json') }}
47+ path : |
48+ ~/.cache/electron
49+ ~/.cache/electron-builder
50+ key : electron-ubuntu-latest-${{ hashFiles('package.json', 'package.json') }}
5651 restore-keys : |
57- npm-${{ runner.os }}-node-24 -
52+ electron-ubuntu-latest -
5853
59- - name : Install root deps (no scripts)
60- run : npm install --ignore-scripts --no-audit --no-fund
54+ - name : Build Electron app
55+ shell : bash
56+ run : npm run build:electron
6157
62- - name : Install Electron Forge deps
63- run : npm run frontend:electron:dependencies
58+ - name : Upload artifact
59+ uses : actions/upload-artifact@v4
60+ with :
61+ name : FromChat-linux
62+ path : |
63+ frontend/build/electron/forge/make/*/**
64+ if-no-files-found : error
65+
66+ build-macos :
67+ name : Build macOS
68+ runs-on : macos-latest
69+
70+ steps :
71+ - name : Checkout
72+ uses : actions/checkout@v4
6473
65- - name : Cache Electron downloads (Linux/macOS)
66- if : runner.os != 'Windows'
74+ - name : Setup Node.js
75+ uses : actions/setup-node@v4
76+ with :
77+ node-version : ' 24'
78+
79+ - name : Cache dependencies
6780 uses : actions/cache@v4
6881 with :
82+ path : node_modules
83+ key : npm-macos-latest-node-24-${{ hashFiles('package.json') }}
84+ restore-keys : |
85+ npm-macos-latest-node-24-
86+
87+ - name : Install dependencies
88+ run : npm install --ignore-scripts --no-audit --no-fund
89+
90+ # - name: Cache Electron downloads
91+ # uses: actions/cache@v4
92+ # with:
93+ # path: |
94+ # ~/.cache/electron
95+ # ~/.cache/electron-builder
96+ # key: electron-macos-latest-${{ hashFiles('package.json') }}
97+ # restore-keys: |
98+ # electron-macos-latest-
99+
100+ - name : Build Electron app
101+ shell : bash
102+ run : npm run build:electron
103+
104+ - name : Upload artifact
105+ uses : actions/upload-artifact@v4
106+ with :
107+ name : FromChat-macOS
69108 path : |
70- ~/.cache/electron
71- ~/.cache/electron-builder
72- key : electron-${{ runner.os }}-${{ hashFiles('package.json', 'frontend/electron/forge/package.json') }}
109+ frontend/build/electron/forge/make/zip/darwin/*/**.zip
110+ if-no-files-found : error
111+
112+ build-windows :
113+ name : Build Windows
114+ runs-on : windows-latest
115+
116+ steps :
117+ - name : Checkout
118+ uses : actions/checkout@v4
119+
120+ - name : Force npm to use Bash
121+ run : npm config set script-shell "C:\Program Files\Git\bin\bash.exe"
122+
123+ - name : Setup Node.js
124+ uses : actions/setup-node@v4
125+ with :
126+ node-version : ' 24'
127+
128+ - name : Cache dependencies
129+ uses : actions/cache@v4
130+ with :
131+ path : node_modules
132+ key : npm-windows-latest-node-24-${{ hashFiles('package.json') }}
73133 restore-keys : |
74- electron-${{ runner.os }} -
134+ npm-windows-latest-node-24 -
75135
76- - name : Cache Electron downloads (Windows)
77- if : runner.os == 'Windows'
136+ - name : Install dependencies
137+ run : npm install --ignore-scripts --no-audit --no-fund
138+
139+ - name : Cache Electron downloads
78140 uses : actions/cache@v4
79141 with :
80142 path : |
81143 ~\AppData\Local\electron\Cache
82144 ~\AppData\Local\electron-builder\Cache
83- key : electron-${{ runner.os }}- ${{ hashFiles('package.json', 'frontend/electron/forge/ package.json') }}
145+ key : electron-windows-latest- ${{ hashFiles('package.json') }}
84146 restore-keys : |
85- electron-${{ runner.os }} -
147+ electron-windows-latest -
86148
87149 - name : Build Electron app
88150 shell : bash
91153 - name : Upload artifact
92154 uses : actions/upload-artifact@v4
93155 with :
94- name : fromchat-${{ runner.os }}
156+ name : FromChat-windows
95157 path : |
96- frontend/electron/forge/out/**
97- if-no-files-found : error
98-
158+ frontend/build/electron/forge/make/zip/win32/x64
159+ if-no-files-found : error
0 commit comments