diff --git a/.github/workflows/electron-build.yml b/.github/workflows/electron-build.yml index 670901d8..097b3836 100644 --- a/.github/workflows/electron-build.yml +++ b/.github/workflows/electron-build.yml @@ -169,22 +169,21 @@ jobs: echo "Imported certificates:" security find-identity -v -p codesigning $KEYCHAIN_PATH - - name: Set version for build - if: steps.check_certs.outputs.has_certs == 'true' - run: | - # Get current version and extract major.minor - CURRENT_VERSION=$(node -p "require('./package.json').version") - MAJOR_MINOR=$(echo $CURRENT_VERSION | cut -d. -f1-2) - NEW_VERSION="${MAJOR_MINOR}.${{ github.run_number }}" - - npm version $NEW_VERSION --no-git-tag-version - echo "✅ Version set to: $NEW_VERSION" - - name: Build macOS App Store Package if: steps.check_certs.outputs.has_certs == 'true' env: ELECTRON_BUILDER_ALLOW_UNRESOLVED_DEPENDENCIES: true - run: npm run build:mac + run: | + # Get current version and extract major.minor + CURRENT_VERSION=$(node -p "require('./package.json').version") + MAJOR_MINOR=$(echo $CURRENT_VERSION | cut -d. -f1-2) + BUILD_VERSION="${MAJOR_MINOR}.${{ github.run_number }}" + + echo "✅ Package version: $CURRENT_VERSION (unchanged)" + echo "✅ Build version for Apple: $BUILD_VERSION" + + # Build with custom buildVersion without modifying package.json + npm run build && electron-builder --mac --universal --config.buildVersion="$BUILD_VERSION" - name: List release directory if: steps.check_certs.outputs.has_certs == 'true' diff --git a/electron-builder.json b/electron-builder.json index 816c1351..75860d18 100644 --- a/electron-builder.json +++ b/electron-builder.json @@ -67,7 +67,7 @@ "arch": "universal" } ], - "icon": "public/icon.icns", + "icon": "public/icon-mac.png", "category": "public.app-category.developer-tools", "hardenedRuntime": true, "gatekeeperAssess": false, diff --git a/electron/main.cjs b/electron/main.cjs index dadeee4b..b651f8d9 100644 --- a/electron/main.cjs +++ b/electron/main.cjs @@ -1,4 +1,4 @@ -const { app, BrowserWindow, shell, ipcMain, dialog } = require("electron"); +const { app, BrowserWindow, shell, ipcMain, dialog, Menu } = require("electron"); const path = require("path"); const fs = require("fs"); const os = require("os"); @@ -462,7 +462,68 @@ ipcMain.handle("test-server-connection", async (event, serverUrl) => { } }); +function createMenu() { + if (process.platform === "darwin") { + const template = [ + { + label: app.name, + submenu: [ + { role: "about" }, + { type: "separator" }, + { role: "services" }, + { type: "separator" }, + { role: "hide" }, + { role: "hideOthers" }, + { role: "unhide" }, + { type: "separator" }, + { role: "quit" }, + ], + }, + { + label: "Edit", + submenu: [ + { role: "undo" }, + { role: "redo" }, + { type: "separator" }, + { role: "cut" }, + { role: "copy" }, + { role: "paste" }, + { role: "selectAll" }, + ], + }, + { + label: "View", + submenu: [ + { role: "reload" }, + { role: "forceReload" }, + { role: "toggleDevTools" }, + { type: "separator" }, + { role: "resetZoom" }, + { role: "zoomIn" }, + { role: "zoomOut" }, + { type: "separator" }, + { role: "togglefullscreen" }, + ], + }, + { + label: "Window", + submenu: [ + { role: "minimize" }, + { role: "zoom" }, + { type: "separator" }, + { role: "front" }, + { type: "separator" }, + { role: "window" }, + ], + }, + ]; + const menu = Menu.buildFromTemplate(template); + Menu.setApplicationMenu(menu); + } +} + app.whenReady().then(() => { + createMenu(); createWindow(); }); diff --git a/public/icon-mac.png b/public/icon-mac.png new file mode 100644 index 00000000..19f7681e Binary files /dev/null and b/public/icon-mac.png differ diff --git a/public/icon.icns b/public/icon.icns deleted file mode 100644 index 49e22cfc..00000000 Binary files a/public/icon.icns and /dev/null differ