From 4a32fc362ed19f353e1cbf0b0b7ba68210ac95c2 Mon Sep 17 00:00:00 2001 From: Lutz Roeder Date: Thu, 28 Nov 2024 15:35:47 -0800 Subject: [PATCH] Update forge.config.js (#632) --- .github/workflows/publish.yml | 1 + package.js | 13 +++++++----- publish/forge.config.js | 39 +++++++++++++++++++++++++---------- 3 files changed, 37 insertions(+), 16 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1083513ad9..a8964854e7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -60,6 +60,7 @@ jobs: ;; ubuntu*) sudo snap install snapcraft --classic + sudo snap install multipass npx electron-builder --linux appimage --x64 --publish always npx electron-builder --linux snap --x64 --publish always ;; diff --git a/package.js b/package.js index efe4c9a2d7..87be5f416f 100644 --- a/package.js +++ b/package.js @@ -589,11 +589,14 @@ const forge = async() => { const command = read(); switch (command) { case 'install': { - await exec('npm install @electron-forge/cli@7.3.0'); - await exec('npm install @electron-forge/core@7.3.0'); - await exec('npm install @electron-forge/maker-snap@7.3.0'); - await exec('npm install @electron-forge/maker-dmg@7.3.0'); - await exec('npm install @electron-forge/maker-zip@7.3.0'); + const packages = [ + '@electron-forge/cli', + '@electron-forge/core', + '@electron-forge/maker-snap', + '@electron-forge/maker-dmg', + '@electron-forge/maker-zip' + ]; + await exec(`npm install ${packages.join(' ')} --no-save`); break; } case 'update': { diff --git a/publish/forge.config.js b/publish/forge.config.js index 1875e4c719..9f12cb6337 100644 --- a/publish/forge.config.js +++ b/publish/forge.config.js @@ -7,15 +7,15 @@ const APPLE_API_KEY_ISSUER_ID = process.env.APPLE_API_KEY_ISSUER_ID; export default { outDir: 'dist', packagerConfig: { - icon: "publish/icon", + icon: 'publish/icon', dir: [ 'source' ], ignore: [ - "publish", - "third_party", - "test", - "tools" + 'publish', + 'third_party', + 'test', + 'tools' ], /* osxNotarize: { @@ -39,7 +39,7 @@ export default { name: '@electron-forge/maker-zip', config: { platforms: ['darwin'], - // name: "${name}-${version}-mac.zip" + // name: '${name}-${version}-mac.zip' } }, { @@ -47,19 +47,36 @@ export default { config: { background: './publish/background.png', /* eslint-disable no-template-curly-in-string */ - name: "Netron-${version}" + name: 'Netron-${version}' /* eslint-enable no-template-curly-in-string */ } + }, + { + // sudo snap install snapcraft --classic + // sudo snap install multipass + // DEBUG=electron-forge:* npx electron-forge make --arch arm64 --targets=@electron-forge/maker-snap + name: '@electron-forge/maker-snap', + platforms: ['linux'], + config: { + grade: 'stable', + base: 'core20', // sudo snap install snapcraft --classic --channel=7.x/stable + appPlugs: [ + 'default', + 'removable-media' + ], + } } ], publishers: [ { - "name": "@electron-forge/publisher-github", - "config": {} + 'name': '@electron-forge/publisher-github', + 'config': {} }, { - "name": "@electron-forge/publisher-snapcraft", - "config": {} + 'name': '@electron-forge/publisher-snapcraft', + 'config': { + release: 'latest/stable' + } } ] };