Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 29 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ jobs:
timeout-minutes: 30

steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Checkout code (full history for lint ratchet merge-base)
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 22
cache: npm
Expand All @@ -40,7 +42,7 @@ jobs:
src/proxy-server/package-lock.json

- name: Cache Electron binaries
uses: actions/cache@v4
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: |
~\AppData\Local\electron\Cache
Expand All @@ -55,27 +57,36 @@ jobs:
- name: Install proxy-server dependencies
run: npm ci --prefix src/proxy-server

- name: Audit production dependencies
# 生产依赖 0 漏洞为发布门禁(开发链已知项单独跟踪,见 CHANGELOG Release blockers 一节)。
run: |
npm audit --omit=dev
npm audit --omit=dev --prefix src/proxy-server

- name: Type check
run: npm run type-check

- name: Build proxy-server
run: npm run build --prefix src/proxy-server

- name: Lint (informational, 渐进治理中)
# 当前存在 71 个 error(多为 @typescript-eslint/ban-types 的 `{}` 类型与 no-explicit-any),
# 暂不阻塞 CI,避免一次性卡死构建。治理路线:分批修复后改为阻塞式门禁。
# 详见 docs/13-项目SDLC规范化分析报告.md 的「质量门禁加固」章节。
continue-on-error: true
- name: Lint (blocking)
# 2026-09-04:全量 lint 已清零(历史遗留 71 个 error 已在 v1.5.0 分支消化),
# 转为阻塞式门禁;lint:changed ratchet 作为变更文件级双重保护保留。
run: npm run lint

- name: Lint ratchet (changed files, blocking)
# 增量门禁:相对 base 分支变更的文件不得新增 lint error(存量不阻塞、不得新增)。
run: npm run lint:changed

- name: Run tests with coverage
run: npm run test -- --run --coverage

- name: Upload coverage report
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: coverage-report-${{ github.ref_name }}
# PR 事件的 ref_name 形如 "2/merge",含 "/" 不是合法 artifact 名;用 run_id 规避
name: coverage-report-${{ github.run_id }}
path: coverage/
if-no-files-found: warn

Expand All @@ -93,10 +104,10 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4

- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 22
cache: npm
Expand All @@ -105,7 +116,7 @@ jobs:
src/proxy-server/package-lock.json

- name: Cache Electron binaries
uses: actions/cache@v4
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: |
~\AppData\Local\electron\Cache
Expand All @@ -130,7 +141,7 @@ jobs:
run: npx electron-builder --win portable zip nsis --publish=never

- name: Upload artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: windows-release-${{ github.ref_name }}
path: |
Expand All @@ -139,12 +150,13 @@ jobs:
if-no-files-found: error

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2
with:
files: |
release/*.exe
release/*.zip
draft: false
# RC 安全惯例:先以 draft 创建,维护者按本地验收清单完成手动验收后再手动 publish。
draft: true
prerelease: false
generate_release_notes: true
env:
Expand Down
18 changes: 17 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ build/Release
node_modules/
jspm_packages/

# Local Python tooling environments
.venv/

# Local Semgrep audit artifacts (the reviewed report remains tracked)
.semgrep/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

Expand Down Expand Up @@ -76,6 +82,12 @@ web_modules/
.env.production.local
.env.local

# Offline publisher/private keys(public verification keys must be reviewed explicitly before tracking)
.keys/
*.private.pem
registry-private-key*.pem
secrets/

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
Expand Down Expand Up @@ -130,6 +142,8 @@ dist
dist-electron/
release/
out/
coverage/
.mimosa/

# IDE
.vscode/
Expand Down Expand Up @@ -170,10 +184,12 @@ tools/
web/

# 项目内部文档资料(仅本地维护,不上传仓库)
# 保留根目录 README.md / README_CN.md(项目介绍)与 CHANGELOG.md(版本记录)对外公开
# 保留根目录 README.md / README_CN.md(项目介绍)、CHANGELOG.md(版本记录)、
# ARCHITECTURE.md / CAPABILITIES.md(对外架构与能力说明)与 SECURITY_AUDIT_REPORT.md(审计证据)
docs/
**/README.md
!/README.md
DEVELOPMENT.md

# 备份文件(防止误提交)
*.bak
Expand Down
Loading
Loading