From 4fae044cb61c7bb9e4bfbec51a69ea1e4f032837 Mon Sep 17 00:00:00 2001 From: Ben <30801141+asdwsxzc123@users.noreply.github.com> Date: Mon, 7 Aug 2023 23:04:25 +0800 Subject: [PATCH 1/3] fix: build:win:noSign Error (#336) --- scripts/baseConfig.ts | 72 +++++++++++++++++++++++++++++++++++++ scripts/build.ts | 81 ++++-------------------------------------- scripts/buildNoSign.ts | 9 +++-- 3 files changed, 83 insertions(+), 79 deletions(-) create mode 100644 scripts/baseConfig.ts diff --git a/scripts/baseConfig.ts b/scripts/baseConfig.ts new file mode 100644 index 00000000..6f9bc0f1 --- /dev/null +++ b/scripts/baseConfig.ts @@ -0,0 +1,72 @@ +import { Configuration } from 'electron-builder'; + +import { COMMON_APP_CONFIG } from '../src/environment'; + +export const ELECTRON_BUILD_CONFIG: Configuration = { + appId: '.postcat.io', + productName: 'Postcat', + asar: true, + directories: { + output: 'release/' + }, + files: [ + 'out/app/**/*.js*', + 'out/platform/**/*.js*', + 'out/environment.js', + 'out/shared/**/*.js*', + 'src/browser/dist/**/*', + 'out/browser/src/**/*.js*', + 'out/node/test-server/**/*.js*', + 'out/app/common/**/*', + '!**/*.ts' + ], + publish: [ + 'github', + { + provider: 'generic', + url: COMMON_APP_CONFIG.BASE_DOWNLOAD_URL + } + ], + generateUpdatesFilesForAllChannels: true, + nsis: { + // 指定guid,此guid会存放在注册表中,如果没有指定则系统会自动生成 + guid: 'Postcat', + oneClick: false, + allowElevation: true, + allowToChangeInstallationDirectory: true, + // for win - 将协议写入主机的脚本 + include: 'scripts/urlProtoco.nsh' + }, + protocols: [ + // for macOS - 用于在主机注册指定协议 + { + name: 'eoapi', + schemes: ['eoapi'] + } + ], + portable: { + splashImage: 'src/app/common/images/postcat.bmp' + }, + dmg: { + sign: false + }, + afterSign: 'scripts/notarize.js', + linux: { + icon: 'src/app/common/images/', + target: ['AppImage'] + }, + mac: { + icon: 'src/app/common/images/512x512.png', + hardenedRuntime: true, + category: 'public.app-category.productivity', + gatekeeperAssess: false, + entitlements: 'scripts/entitlements.mac.plist', + entitlementsInherit: 'scripts/entitlements.mac.plist', + target: [ + { + target: 'default', + arch: ['x64', 'arm64'] + } + ] + } +}; diff --git a/scripts/build.ts b/scripts/build.ts index 739e4341..3d8a817b 100644 --- a/scripts/build.ts +++ b/scripts/build.ts @@ -1,16 +1,16 @@ -import { sign, doSign } from 'app-builder-lib/out/codeSign/windowsCodeSign'; -import { build, BuildResult, Platform } from 'electron-builder'; +import { doSign, sign } from 'app-builder-lib/out/codeSign/windowsCodeSign'; import type { Configuration } from 'electron-builder'; +import { Platform, build } from 'electron-builder'; import minimist from 'minimist'; import YAML from 'yaml'; import pkgInfo from '../package.json'; -import { COMMON_APP_CONFIG } from '../src/environment'; +import { ELECTRON_BUILD_CONFIG } from './baseConfig'; -import { execSync, exec, spawn } from 'node:child_process'; +import { exec, execSync, spawn } from 'node:child_process'; import { createHash } from 'node:crypto'; -import { copyFileSync, createReadStream, readFileSync, writeFileSync } from 'node:fs'; -import path, { resolve } from 'node:path'; +import { createReadStream, readFileSync, writeFileSync } from 'node:fs'; +import path from 'node:path'; import { exit, platform } from 'node:process'; const pkgPath = path.join(__dirname, '../package.json'); @@ -52,74 +52,7 @@ function hashFile(file: string, algorithm = 'sha512', encoding: 'base64' | 'hex' .pipe(hash, { end: false }); }); } -export const ELECTRON_BUILD_CONFIG: Configuration = { - appId: '.postcat.io', - productName: 'Postcat', - asar: true, - directories: { - output: 'release/' - }, - files: [ - 'out/app/**/*.js*', - 'out/platform/**/*.js*', - 'out/environment.js', - 'out/shared/**/*.js*', - 'src/browser/dist/**/*', - 'out/browser/src/**/*.js*', - 'out/node/test-server/**/*.js*', - 'out/app/common/**/*', - '!**/*.ts' - ], - publish: [ - 'github', - { - provider: 'generic', - url: COMMON_APP_CONFIG.BASE_DOWNLOAD_URL - } - ], - generateUpdatesFilesForAllChannels: true, - nsis: { - // 指定guid,此guid会存放在注册表中,如果没有指定则系统会自动生成 - guid: 'Postcat', - oneClick: false, - allowElevation: true, - allowToChangeInstallationDirectory: true, - // for win - 将协议写入主机的脚本 - include: 'scripts/urlProtoco.nsh' - }, - protocols: [ - // for macOS - 用于在主机注册指定协议 - { - name: 'eoapi', - schemes: ['eoapi'] - } - ], - portable: { - splashImage: 'src/app/common/images/postcat.bmp' - }, - dmg: { - sign: false - }, - afterSign: 'scripts/notarize.js', - linux: { - icon: 'src/app/common/images/', - target: ['AppImage'] - }, - mac: { - icon: 'src/app/common/images/512x512.png', - hardenedRuntime: true, - category: 'public.app-category.productivity', - gatekeeperAssess: false, - entitlements: 'scripts/entitlements.mac.plist', - entitlementsInherit: 'scripts/entitlements.mac.plist', - target: [ - { - target: 'default', - arch: ['x64', 'arm64'] - } - ] - } -}; + const config: Configuration = { ...ELECTRON_BUILD_CONFIG, win: { diff --git a/scripts/buildNoSign.ts b/scripts/buildNoSign.ts index 3fe2009e..62b9ff99 100644 --- a/scripts/buildNoSign.ts +++ b/scripts/buildNoSign.ts @@ -1,15 +1,14 @@ -import { sign, doSign } from 'app-builder-lib/out/codeSign/windowsCodeSign'; -import { build, BuildResult, Platform } from 'electron-builder'; +import { sign } from 'app-builder-lib/out/codeSign/windowsCodeSign'; import type { Configuration } from 'electron-builder'; +import { Platform, build } from 'electron-builder'; import minimist from 'minimist'; -import YAML from 'yaml'; import pkgInfo from '../package.json'; -import { ELECTRON_BUILD_CONFIG } from './build'; +import { ELECTRON_BUILD_CONFIG } from './baseConfig'; import { exec, spawn } from 'node:child_process'; import { writeFileSync } from 'node:fs'; -import path, { resolve } from 'node:path'; +import path from 'node:path'; import { exit, platform } from 'node:process'; const pkgPath = path.join(__dirname, '../package.json'); -- Gitee From 12850fb724e8f5f9ce40f99637e49ad5d27abd05 Mon Sep 17 00:00:00 2001 From: scarqin <1054139596@qq.com> Date: Tue, 8 Aug 2023 12:27:55 +0800 Subject: [PATCH 2/3] docs: add contrib.rocks --- README.md | 14 ++++++++++++-- wiki/README.en.md | 13 +++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6a7dc1a5..b1a5867f 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,18 @@ 也欢迎给我们多多提需求~ +## 💪 贡献者 💪 +
+感谢你们让美好发生! +
+ + ++Thank you for making good things happen! +
+ + +