Skip to content

Commit 2bbb94c

Browse files
committed
build: windows
1 parent 0e0a9a2 commit 2bbb94c

File tree

3 files changed

+10
-24
lines changed

3 files changed

+10
-24
lines changed

.github/workflows/build.yml

+3-5
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ jobs:
2727
- name: Install dependencies
2828
run: npm install
2929

30-
- name: Package the app for Linux, Windows, and macOS
30+
- name: Package the app for Windows
3131
run: |
32-
# Build for Linux, Windows, and macOS without publishing
33-
npx electron-builder --linux AppImage --win nsis --mac dmg -p never
32+
# Build for Windows without publishing
33+
npx electron-builder --win nsis -p never
3434
env:
3535
GH_TOKEN: ${{ secrets.GH_TOKEN }} # Use your GitHub token with write permissions
3636

@@ -40,9 +40,7 @@ jobs:
4040
tag: 'v${{ github.run_number }}'
4141
name: 'TheCyberHUB Desktop Release v${{ github.run_number }}'
4242
files: |
43-
dist/*.AppImage
4443
dist/*.exe
45-
dist/*.dmg
4644
env:
4745
GH_TOKEN: ${{ secrets.GH_TOKEN }}
4846
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

package.json

+1-14
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@
99
"scripts": {
1010
"start": "electron .",
1111
"package": "electron-builder",
12-
"build": "npm run build:linux && npm run build:windows",
13-
"build:linux": "electron-builder --linux AppImage -p never",
12+
"build": "npm run build:windows",
1413
"build:windows": "electron-builder --win nsis -p never",
15-
"build:mac": "npm install --no-optional && electron-builder --mac -p never",
1614
"lint": "eslint .",
1715
"test": "echo \"No tests specified\" && exit 0"
1816
},
@@ -23,17 +21,6 @@
2321
"src/main.js"
2422
],
2523
"icon": "dict/assets/th3cyb3rhub-fav.png",
26-
"mac": {
27-
"category": "public.app-category.utilities",
28-
"target": [
29-
"dmg"
30-
]
31-
},
32-
"linux": {
33-
"target": [
34-
"AppImage"
35-
]
36-
},
3724
"win": {
3825
"target": [
3926
"nsis"

src/main.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,17 @@ function createWindow() {
1414
win.loadFile(path.join(__dirname, '../dist/index.html'));
1515
}
1616

17-
app.whenReady().then(createWindow);
18-
17+
// Quit the application when all windows are closed
1918
app.on('window-all-closed', () => {
20-
if (process.platform !== 'darwin') {
21-
app.quit();
22-
}
19+
app.quit();
2320
});
2421

22+
// Create a window when the application is activated
2523
app.on('activate', () => {
2624
if (BrowserWindow.getAllWindows().length === 0) {
2725
createWindow();
2826
}
2927
});
28+
29+
// Start the application and create the window
30+
app.whenReady().then(createWindow);

0 commit comments

Comments
 (0)