feat: support release windows installer with squirrel (#1965)

Co-authored-by: Himself65 <himself65@outlook.com>
This commit is contained in:
Horus 2023-04-17 08:28:29 +08:00 committed by GitHub
parent c76bbeab67
commit 134e1e8668
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 30 additions and 2 deletions

View File

@ -140,8 +140,11 @@ jobs:
- name: Save windows artifacts
run: |
mkdir -p builds
mv apps/electron/out/make/zip/win32/x64/AFFiNE-win32-x64-0.0.0.zip ./builds/affine-windows-x64.zip
mv apps/electron/out/make/zip/win32/x64/AFFiNE-win32-x64-*.zip ./builds/affine-windows-x64.zip
mv apps/electron/out/make/squirrel.windows/x64/*.exe ./builds/affine-windows-x64.exe
mv apps/electron/out/make/squirrel.windows/x64/*.msi ./builds/affine-windows-x64.msi
mv apps/electron/out/make/squirrel.windows/x64/*.nupkg ./builds/affine-windows-x64.nupkg
mv apps/electron/out/make/squirrel.windows/x64/RELEASES ./builds/RELEASES
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:

View File

@ -32,6 +32,14 @@ module.exports = {
setupIcon: './resources/icons/icon.ico',
},
},
{
name: '@electron-forge/maker-squirrel',
config: {
name: 'AFFiNE',
setupIcon: './resources/icons/icon.ico',
// loadingGif: './resources/icons/loading.gif',
},
},
],
hooks: {
generateAssets: async (_, platform, arch) => {
@ -43,6 +51,11 @@ module.exports = {
process.env.TARGET = 'aarch64-apple-darwin';
}
if (platform === 'win32') {
$.shell = 'powershell.exe';
$.prefix = '';
}
// run yarn generate-assets
await $`yarn generate-assets`;
},

View File

@ -7,6 +7,7 @@ import { registerHandlers } from './app-state';
import { restoreOrCreateWindow } from './main-window';
import { registerProtocol } from './protocol';
if (require('electron-squirrel-startup')) app.exit();
if (process.defaultApp) {
if (process.argv.length >= 2) {
app.setAsDefaultProtocolClient('affine', process.execPath, [

View File

@ -39,6 +39,7 @@
"@electron/remote": "2.0.9",
"dts-for-context-bridge": "^0.7.1",
"electron": "24.0.0",
"electron-squirrel-startup": "1.0.0",
"esbuild": "^0.17.16",
"zx": "^7.2.1"
},

View File

@ -129,6 +129,7 @@ __metadata:
cross-env: 7.0.3
dts-for-context-bridge: ^0.7.1
electron: 24.0.0
electron-squirrel-startup: 1.0.0
electron-window-state: ^5.0.3
esbuild: ^0.17.16
firebase: ^9.18.0
@ -8569,6 +8570,15 @@ __metadata:
languageName: node
linkType: hard
"electron-squirrel-startup@npm:1.0.0":
version: 1.0.0
resolution: "electron-squirrel-startup@npm:1.0.0"
dependencies:
debug: ^2.2.0
checksum: a1f658e326bd0f5c24aec95fd9a94a2e2b8b645adbd421465829f32719d15e85d6469d9369914c3b766d61e71eebb9f6725057b7fafa78adbcc5d6d3ce5d7a22
languageName: node
linkType: hard
"electron-to-chromium@npm:^1.4.284":
version: 1.4.361
resolution: "electron-to-chromium@npm:1.4.361"