Skip to content

Commit 089313b

Browse files
committed
完善开源规范与自动发布流程
1 parent a99d949 commit 089313b

22 files changed

Lines changed: 955 additions & 20 deletions
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: 缺陷报告
2+
description: 报告标注、笔记保存、恢复或界面中的问题
3+
title: '[Bug] '
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
安全漏洞请使用[私密报告](https://github.com/aredddd/GlassNote/security/advisories/new),不要公开利用细节。
9+
备份包含 URL、摘录、前后文和笔记。请使用公开网页或合成示例,不要上传真实完整备份、令牌、账号信息或私人截图。
10+
- type: checkboxes
11+
id: preparation
12+
attributes:
13+
label: 提交前确认
14+
options:
15+
- label: 我已搜索已有 Issue,未找到能覆盖此问题的报告。
16+
required: true
17+
- label: 以下内容及附件已经脱敏,不含私人笔记、完整真实备份或凭据。
18+
required: true
19+
- type: textarea
20+
id: environment
21+
attributes:
22+
label: 使用环境
23+
description: 可在浏览器扩展管理页查看 GlassNote 版本。
24+
placeholder: |
25+
GlassNote 版本或提交:
26+
浏览器名称与完整版本:
27+
操作系统:
28+
安装方式(源码加载、下载包、商店等):
29+
validations:
30+
required: true
31+
- type: textarea
32+
id: reproduction
33+
attributes:
34+
label: 复现步骤
35+
description: 写明是首次创建、刷新、关闭重开、页面切换、升级还是导入后出现。
36+
placeholder: |
37+
1. 打开……
38+
2. 选择……并保存……
39+
3. 刷新或重新打开后……
40+
validations:
41+
required: true
42+
- type: textarea
43+
id: expected_actual
44+
attributes:
45+
label: 预期与实际结果
46+
description: 如果标注消失或漂移,请说明笔记库里是否仍能看到摘录和想法,以及是否提示未定位或保存失败。
47+
placeholder: |
48+
预期:
49+
实际:
50+
出现频率:
51+
validations:
52+
required: true
53+
- type: textarea
54+
id: sample
55+
attributes:
56+
label: 最小示例与截图
57+
description: 可提供公开页面地址、最小 HTML、合成备份或脱敏截图。私人网页不必提供原地址;请用示例文字描述结构。
58+
- type: textarea
59+
id: logs
60+
attributes:
61+
label: 错误信息或其他线索
62+
description: 如有错误提示,请粘贴相关片段。不要附上整个浏览器配置或未经检查的日志。

‎.github/ISSUE_TEMPLATE/config.yml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: 私密安全报告
4+
url: https://github.com/aredddd/GlassNote/security/advisories/new
5+
about: 漏洞利用细节和敏感复现材料请勿发布到公开 Issue。
6+
- name: 使用说明与支持范围
7+
url: https://github.com/aredddd/GlassNote/blob/main/README.md
8+
about: 查看安装、升级、备份与网页兼容范围。
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: 功能建议
2+
description: 说明阅读或整理笔记时遇到的问题与希望改进的行为
3+
title: '[建议] '
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
请从具体使用场景出发。涉及私人文章或笔记时,请使用虚构示例;安全问题请走[私密报告](https://github.com/aredddd/GlassNote/security/advisories/new)。
9+
- type: checkboxes
10+
id: preparation
11+
attributes:
12+
label: 提交前确认
13+
options:
14+
- label: 我已查看现有功能说明并搜索已有 Issue。
15+
required: true
16+
- type: textarea
17+
id: problem
18+
attributes:
19+
label: 你遇到了什么问题?
20+
description: 描述阅读、标注、恢复或整理笔记时的具体场景,以及现有操作为什么不方便。
21+
validations:
22+
required: true
23+
- type: textarea
24+
id: proposal
25+
attributes:
26+
label: 期望怎样改进?
27+
description: 用一次实际操作说明希望看到的行为或结果。
28+
validations:
29+
required: true
30+
- type: textarea
31+
id: alternatives
32+
attributes:
33+
label: 现有做法与替代方案
34+
description: 如果已有临时解决办法,也请说明它的限制。
35+
- type: textarea
36+
id: scope
37+
attributes:
38+
label: 其他说明
39+
description: 可附脱敏示意图。若涉及同步、网络服务或新增权限,请说明这些能力为什么是该场景所必需的。

‎.github/PULL_REQUEST_TEMPLATE.md‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## 问题与改动
2+
3+
<!-- 写清具体触发条件、原来的问题及修改后的行为。有关联 Issue 时附链接。 -->
4+
5+
## 验证
6+
7+
<!-- 列出实际执行的命令和结果。网页交互、存储迁移或 UI 改动请补对应验证;未执行或未覆盖的检查写明原因。截图使用公开或合成内容。 -->
8+
9+
## 影响与限制
10+
11+
<!-- 说明对旧数据、原文定位、权限、隐私或依赖的影响;没有相关变化可写“不涉及”。引入第三方材料时注明来源与许可证。 -->
12+
13+
## 提交前检查
14+
15+
- [ ] 我已阅读 [贡献指南](https://github.com/aredddd/GlassNote/blob/main/CONTRIBUTING.md),确认有权提交这些内容。
16+
- [ ] 已检查附件和修改内容,不含私人笔记、真实完整备份、浏览器配置、令牌或无关产物。
17+
- [ ] 已完成与改动有关的验证,并写明尚未验证的情况。
18+
- [ ] 如涉及数据格式、导入迁移、权限或数据处理,已补相应回归并更新相关说明;不涉及则勾选。

‎.github/workflows/ci.yml‎

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: ['**']
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
11+
concurrency:
12+
group: ci-${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
verify:
17+
name: 格式、单元测试与真实扩展回归
18+
runs-on: ubuntu-24.04
19+
timeout-minutes: 20
20+
steps:
21+
- name: 检出代码
22+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
23+
with:
24+
persist-credentials: false
25+
26+
- name: 设置 Node.js
27+
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
28+
with:
29+
node-version: '24'
30+
cache: npm
31+
32+
- name: 按锁文件安装开发依赖
33+
run: npm ci
34+
35+
- name: 检查语法、扩展入口和格式
36+
run: |
37+
npm run check
38+
npm run format:check
39+
40+
- name: 安装测试浏览器
41+
run: npx playwright install --with-deps chromium
42+
43+
- name: 运行单元测试
44+
run: npm test
45+
46+
- name: 运行真实扩展回归
47+
run: npm run test:e2e
48+
49+
# 测试使用隔离浏览器与本地网页,不自动访问用户指定的真实网站。
50+
- name: 构建并验证发布包
51+
run: |
52+
npm run package
53+
npm run package:verify
54+
55+
- name: 保留失败时的测试截图
56+
if: failure()
57+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
58+
with:
59+
name: failed-test-screenshots
60+
path: test-results/
61+
if-no-files-found: ignore
62+
retention-days: 7

‎.github/workflows/release.yml‎

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: 发布扩展
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: read
10+
11+
concurrency:
12+
group: release-${{ github.ref }}
13+
cancel-in-progress: false
14+
15+
jobs:
16+
build:
17+
name: 校验标签、测试并构建
18+
runs-on: ubuntu-24.04
19+
timeout-minutes: 20
20+
steps:
21+
- name: 检出标签源码
22+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
23+
with:
24+
persist-credentials: false
25+
26+
- name: 设置 Node.js
27+
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
28+
with:
29+
node-version: '24'
30+
cache: npm
31+
32+
- name: 校验标签和项目版本
33+
run: node scripts/verify-package.cjs --version-only --tag "$GITHUB_REF_NAME"
34+
35+
- name: 按锁文件安装开发依赖
36+
run: npm ci
37+
38+
- name: 检查语法、扩展入口和格式
39+
run: |
40+
npm run check
41+
npm run format:check
42+
43+
- name: 安装测试浏览器
44+
run: npx playwright install --with-deps chromium
45+
46+
- name: 运行单元测试和真实扩展回归
47+
run: |
48+
npm test
49+
npm run test:e2e
50+
51+
- name: 构建并验证 ZIP 与 SHA256SUMS
52+
run: |
53+
npm run package -- --tag "$GITHUB_REF_NAME"
54+
npm run package:verify -- --tag "$GITHUB_REF_NAME"
55+
56+
- name: 保存经过校验的发布资产
57+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
58+
with:
59+
name: glassnote-release
60+
path: |
61+
dist/GlassNote-${{ github.ref_name }}.zip
62+
dist/SHA256SUMS
63+
if-no-files-found: error
64+
compression-level: 0
65+
retention-days: 7
66+
67+
publish:
68+
name: 发布 GitHub Release
69+
needs: build
70+
runs-on: ubuntu-24.04
71+
timeout-minutes: 5
72+
permissions:
73+
contents: write
74+
steps:
75+
- name: 检出同一标签的校验脚本和发布说明
76+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
77+
with:
78+
persist-credentials: false
79+
80+
- name: 设置 Node.js
81+
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
82+
with:
83+
node-version: '24'
84+
85+
- name: 下载本次构建的发布资产
86+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
87+
with:
88+
name: glassnote-release
89+
path: dist
90+
91+
- name: 发布前复验版本、文件清单和 SHA-256
92+
run: node scripts/verify-package.cjs --tag "$GITHUB_REF_NAME"
93+
94+
- name: 创建 GitHub Release
95+
env:
96+
GH_TOKEN: ${{ github.token }}
97+
run: |
98+
archive="dist/GlassNote-${GITHUB_REF_NAME}.zip"
99+
title="GlassNote ${GITHUB_REF_NAME#v}"
100+
if gh release view "$GITHUB_REF_NAME" >/dev/null 2>&1; then
101+
echo '::error::该标签已经存在 Release,拒绝覆盖已发布资产;请使用新版本。'
102+
exit 1
103+
fi
104+
gh release create "$GITHUB_REF_NAME" "$archive" dist/SHA256SUMS --verify-tag --target "$GITHUB_SHA" --title "$title" --notes-file CHANGELOG.md --draft=false --prerelease=false

‎CHANGELOG.md‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# 更新日志
2+
3+
## [3.0.0] - 2026-09-29
4+
5+
### 新增
6+
7+
- 集中管理所有网页的笔记库,支持搜索、编辑及 JSON 备份导入导出。
8+
- 通过原文、上下文和位置共同定位标注;无法可靠恢复时保留笔记并显示待定位。
9+
- MIT 许可、贡献与安全指南、反馈模板、自动回归及版本打包流程。
10+
11+
### 改进
12+
13+
- 重做扩展弹窗、浮动工具栏和页面笔记面板,采用浅色玻璃质感界面。
14+
- 使用 CSS Custom Highlight API 绘制标注,减少对原网页 DOM 的影响。
15+
- 后台串行写入,兼容旧版数据迁移,保留旧版原始存储。
16+
17+
### 修复
18+
19+
- 修复重开网页后笔记无法显示、重复文本误定位与页面变化后位置漂移的问题。
20+
- 同一处文字再次点击高亮、下划线或加粗即可取消格式;重复点击同色取消高亮,换色更新原记录。
21+
- 取消格式时保留附带笔记;编辑笔记不会重新创建已删除标注。
22+
23+
### 已知限制
24+
25+
- 面向桌面 Edge / Chrome 的普通网页主文档;不支持浏览器内部页、内置 PDF、Canvas、iframe 内文与封闭 Shadow DOM。
26+
- 大幅改写或删除原文后无法保证自动定位;笔记仍保留在笔记库。
27+
- 本地保存,无跨设备同步;Edge 商店发布进度与 GitHub 版本发布分别管理。
28+
29+
更早版本尚未整理为独立发行记录,历史改动见 [Git 提交记录](https://github.com/aredddd/GlassNote/commits/main/)。
30+
31+
[3.0.0]: https://github.com/aredddd/GlassNote/releases/tag/v3.0.0

0 commit comments

Comments
 (0)