diff --git a/CLAUDE.md b/CLAUDE.md index 84b5d4a..927acf3 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -210,7 +210,7 @@ npm run package:appx:dev - `package.json > build.appx`:集中定义 `identityName`、`applicationId`、`publisherDisplayName`、`publisher` 等 AppX 元数据;当前允许本地验证占位值,正式发布前必须替换。 - `package.json > build.toolsets.winCodeSign`:固定为 `1.1.0`,让 `electron-builder` 在 Windows 上使用现代签名工具链并补齐 SHA256 摘要参数。 - AppX 资源位于 `main/assets/appx/`,由现有 `main/assets/focusflow-icon.png` 派生生成。 -- `package-win.mjs` 会预热 `output/cache/electron-builder/`,为 legacy `winCodeSign-2.6.0` cache 提前放入现代 `rcedit`,默认无参数打 `nsis portable`,显式传 `appx` 时只打 `appx`。 +- `package-win.mjs` 会预热 `output/cache/electron-builder/`,为 legacy `winCodeSign-2.6.0` cache 提前放入现代 `rcedit`,默认无参数打 `nsis portable`,显式传 `appx` 时只打 `appx`;调用 electron-builder 时固定传入 `--publish never`,防止 CI push 隐式触发发布。 - 兼容层目标是稳定 exe 图标与版本资源写入;这是项目级 workaround,不是系统权限修复。 - 开发证书脚本位于 `tools/appx/prepare-dev-cert.ps1` 和 `tools/appx/package-dev.ps1`,不要放回被忽略的 `scripts/`。 - 本地开发证书私钥创建在 `CurrentUser\My`,但 AppX 安装信任要导入 `LocalMachine\TrustedPeople`;脚本会优先复用已有机器级信任,缺失时拉起管理员 PowerShell 完成导入。 diff --git a/README.md b/README.md index cd7577a..0b4f248 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # FocusFlow -[![CI](https://github.com/gis2all/focus-flow/actions/workflows/ci.yml/badge.svg)](https://github.com/gis2all/focus-flow/actions/workflows/ci.yml) +[![CI](https://github.com/gis2all/focus-flow/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/gis2all/focus-flow/actions/workflows/ci.yml?query=branch%3Amain) [![Release](https://img.shields.io/github/v/release/gis2all/focus-flow)](https://github.com/gis2all/focus-flow/releases/latest) [![License](https://img.shields.io/github/license/gis2all/focus-flow)](LICENSE) diff --git a/main/packageConfig.test.ts b/main/packageConfig.test.ts index 7fb5cca..3446bdc 100644 --- a/main/packageConfig.test.ts +++ b/main/packageConfig.test.ts @@ -52,6 +52,7 @@ const packageJsonPath = resolve(process.cwd(), 'package.json') const packageHelperPath = resolve(process.cwd(), 'package-win.mjs') const appxAssetPath = resolve(process.cwd(), 'main', 'assets', 'appx') const packageConfig = JSON.parse(readFileSync(packageJsonPath, 'utf-8')) as BuildConfig +const packageHelper = readFileSync(packageHelperPath, 'utf-8') describe('package.json build config', () => { test('keeps the default Windows packaging flow on nsis and portable', () => { @@ -69,6 +70,12 @@ describe('package.json build config', () => { expect(packageConfig.build.portable.artifactName).toBe('focusflow-single.${ext}') }) + test('disables electron-builder implicit publishing in CI', () => { + expect(packageHelper).toContain( + "const windowsPackagingArgs = ['--win', ...requestedWindowsTargets, '--publish', 'never']" + ) + }) + test('keeps appx packaging on a single signed development entrypoint', () => { expect(packageConfig.scripts['package:appx:dev']).toBe( 'powershell -NoProfile -ExecutionPolicy Bypass -File .\\tools\\appx\\package-dev.ps1' diff --git a/package-win.mjs b/package-win.mjs index 9490e51..fc7aca0 100644 --- a/package-win.mjs +++ b/package-win.mjs @@ -78,7 +78,7 @@ async function prepareWinCodeSignCompatibilityCache() { async function runWindowsPackaging() { const cliPath = resolve(projectRoot, 'node_modules', 'electron-builder', 'cli.js') // Keep the default release flow on nsis + portable unless the caller asks for another allowed target set. - const windowsPackagingArgs = ['--win', ...requestedWindowsTargets] + const windowsPackagingArgs = ['--win', ...requestedWindowsTargets, '--publish', 'never'] await new Promise((resolvePromise, rejectPromise) => { const child = spawn(process.execPath, [cliPath, ...windowsPackagingArgs], {