Skip to content

Commit c8eebf3

Browse files
committed
init
0 parents  commit c8eebf3

File tree

5 files changed

+4719
-0
lines changed

5 files changed

+4719
-0
lines changed

.github/workflows/build.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build Electron App
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
workflow_dispatch:
7+
8+
jobs:
9+
build:
10+
runs-on: macos-latest
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v3
14+
15+
- name: Set up Node.js
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: 22
19+
20+
- name: Install dependencies
21+
run: npm install
22+
23+
- name: Build for all platforms
24+
run: npm run build
25+
26+
- name: Upload dmg
27+
uses: actions/upload-artifact@v3
28+
with:
29+
name: macOS
30+
path: dist/*.dmg
31+
32+
- name: Upload exe
33+
uses: actions/upload-artifact@v3
34+
with:
35+
name: windows
36+
path: dist/*.exe
37+
38+
- name: Upload AppImage
39+
uses: actions/upload-artifact@v3
40+
with:
41+
name: linux
42+
path: dist/*.AppImage

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
**/.DS_Store
2+
dist/
3+
node_modules/

index.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
const path = require('path');
2+
const { app, BrowserWindow, screen, Menu } = require('electron')
3+
4+
Menu.setApplicationMenu(null)
5+
if (process.argv.includes('--portable')) app.setPath('userData', path.join(__dirname, 'data'));
6+
7+
const createWindow = () => {
8+
const primaryDisplay = screen.getPrimaryDisplay()
9+
const { width, height } = primaryDisplay.workAreaSize
10+
11+
const win = new BrowserWindow({
12+
width: Math.floor(width * 0.85),
13+
height: Math.floor(height * 0.85),
14+
webPreferences: {
15+
devTools: false,
16+
contextIsolation: true,
17+
nodeIntegration: false,
18+
experimentalFeatures: true
19+
}
20+
})
21+
22+
win.setMenuBarVisibility(false);
23+
win.setAutoHideMenuBar(true);
24+
25+
win.loadURL('https://webmc.xyz/?plaf=desktop');
26+
}
27+
28+
app.whenReady().then(() => {
29+
createWindow();
30+
});

0 commit comments

Comments
 (0)