From 961a87d61b9f9ab61fa981cb962a9853a20eb747 Mon Sep 17 00:00:00 2001 From: Pierre Ferran Date: Tue, 4 Jun 2024 21:48:24 -0400 Subject: [PATCH] Change electron builder config to js for notarize --- electron-builder-config.js | 65 ++++++++++++++++++++++++++++++++++++++ electron-builder.yml | 47 --------------------------- package.json | 8 ++--- 3 files changed, 69 insertions(+), 51 deletions(-) create mode 100644 electron-builder-config.js delete mode 100644 electron-builder.yml diff --git a/electron-builder-config.js b/electron-builder-config.js new file mode 100644 index 0000000..c4d5ed9 --- /dev/null +++ b/electron-builder-config.js @@ -0,0 +1,65 @@ +module.exports = { + appId: 'com.vatsim.trackaudio', + productName: 'TrackAudio', + directories: { + buildResources: 'build' + }, + files: [ + '!**/.vscode/*', + '!src/*', + '!electron.vite.config.{js,ts,mjs,cjs}', + '!{.eslintignore,.eslintrc.cjs,.prettierignore,.prettierrc.yaml,dev-app-update.yml,CHANGELOG.md,README.md}', + '!{.env,.env.*,.npmrc,pnpm-lock.yaml}', + '!{.gitignore,.gitmodules,.sentryclirc,MANDATORY_VERSION}', + '!{tsconfig.json,tsconfig.node.json,tsconfig.web.json}', + '!backend/*' + ], + asarUnpack: [ + 'resources/**' + ], + win: { + executableName: 'trackaudio', + extraFiles: [ + { + from: 'backend/build/Release/', + to: '.', + filter: ['*.dll'] + } + ] + }, + nsis: { + artifactName: '${name}-${version}-${arch}-setup.${ext}', + shortcutName: '${productName}', + uninstallDisplayName: '${productName}', + createDesktopShortcut: 'always' + }, + mac: { + entitlementsInherit: 'build/entitlements.mac.plist', + notarize: { + teamId: process.env.APPLE_TEAM_ID + } + }, + dmg: { + artifactName: '${name}-${version}-${arch}.${ext}' + }, + linux: { + target: [ + 'AppImage', + 'snap', + 'deb' + ], + maintainer: 'pierr3', + category: 'Game' + }, + appImage: { + artifactName: '${name}-${version}-${arch}.${ext}' + }, + npmRebuild: false, + publish: { + provider: 'generic', + url: 'https://example.com/auto-updates' + }, + electronDownload: { + mirror: 'https://npmmirror.com/mirrors/electron/' + } +}; diff --git a/electron-builder.yml b/electron-builder.yml deleted file mode 100644 index b6f654a..0000000 --- a/electron-builder.yml +++ /dev/null @@ -1,47 +0,0 @@ -appId: com.vatsim.trackaudio -productName: TrackAudio -directories: - buildResources: build -files: - - "!**/.vscode/*" - - "!src/*" - - "!electron.vite.config.{js,ts,mjs,cjs}" - - "!{.eslintignore,.eslintrc.cjs,.prettierignore,.prettierrc.yaml,dev-app-update.yml,CHANGELOG.md,README.md}" - - "!{.env,.env.*,.npmrc,pnpm-lock.yaml}" - - "!{.gitignore,.gitmodules,.sentryclirc,MANDATORY_VERSION}" - - "!{tsconfig.json,tsconfig.node.json,tsconfig.web.json}" - - "!backend/*" -asarUnpack: - - resources/** -win: - executableName: trackaudio - extraFiles: - - from: "backend/build/Release/" - to: "." - filter: ["*.dll"] -nsis: - artifactName: ${name}-${version}-${arch}-setup.${ext} - shortcutName: ${productName} - uninstallDisplayName: ${productName} - createDesktopShortcut: always -mac: - entitlementsInherit: build/entitlements.mac.plist - notarize: - tool: notarytool -dmg: - artifactName: ${name}-${version}-${arch}.${ext} -linux: - target: - - AppImage - - snap - - deb - maintainer: pierr3 - category: Game -appImage: - artifactName: ${name}-${version}-${arch}.${ext} -npmRebuild: false -publish: - provider: generic - url: https://example.com/auto-updates -electronDownload: - mirror: https://npmmirror.com/mirrors/electron/ diff --git a/package.json b/package.json index 27e54b6..a070edd 100644 --- a/package.json +++ b/package.json @@ -16,10 +16,10 @@ "dev": "electron-vite dev", "build": "npm run typecheck && electron-vite build", "postinstall": "electron-builder install-app-deps", - "build:unpack": "npm run build && electron-builder --dir", - "build:win": "npm run build && electron-builder --win", - "build:mac": "npm run build && electron-builder --mac", - "build:linux": "npm run build && electron-builder --linux", + "build:unpack": "npm run build && electron-builder --dir -c electron-builder-config.js", + "build:win": "npm run build && electron-builder --win -c electron-builder-config.js", + "build:mac": "npm run build && electron-builder --mac -c electron-builder-config.js", + "build:linux": "npm run build && electron-builder --linux -c electron-builder-config.js", "build:backend": "cd backend && npm install && npm run build && cd .. && npm install ./backend/trackaudio-afv-1.0.0.tgz" }, "dependencies": {