mirror of
https://github.com/firstsun-dev/git-files-sync.git
synced 2026-07-22 17:20:30 +00:00
Major feature release including: - GitHub service support alongside GitLab - Sync status view with visual diff - Batch push/pull operations - Conflict resolution modal - Vault folder filtering - File rename detection - Complete CI/CD workflows (check, auto-release, semantic-release) - Comprehensive documentation (CHANGELOG, COMPLIANCE, RELEASE guides) Co-authored-by: tianyao <tianyao@heavendev01.royal-powan.ts.net> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
3.7 KiB
3.7 KiB
发布新版本指南
本项目提供两种发布方式:
方式一:自动版本管理(推荐)
使用 GitHub Actions 自动更新版本号并发布。
步骤:
- 进入 GitHub 仓库
- 点击 Actions 标签
- 选择 Auto Release workflow
- 点击 Run workflow 按钮
- 选择版本类型:
- patch: 修复 bug (1.0.0 → 1.0.1)
- minor: 新功能 (1.0.0 → 1.1.0)
- major: 重大变更 (1.0.0 → 2.0.0)
- 点击 Run workflow
自动执行的操作:
✅ 运行测试
✅ 更新 package.json 版本号
✅ 更新 manifest.json 版本号
✅ 更新 versions.json
✅ 更新 CHANGELOG.md
✅ 提交并推送更改
✅ 创建 git tag
✅ 创建 GitHub Release
✅ 上传 main.js, manifest.json, styles.css
优点:
- 一键完成所有操作
- 不会遗漏任何步骤
- 版本号自动同步
- 减少人为错误
方式二:手动发布
适合需要更多控制的情况。
步骤:
-
更新版本号
# 修复 bug npm version patch # 新功能 npm version minor # 重大变更 npm version major -
手动更新 manifest.json
# 编辑 manifest.json,更新 version 字段 -
手动更新 versions.json
{ "1.0.0": "0.15.0", "1.0.1": "0.15.0" // 添加新版本 } -
更新 CHANGELOG.md
## [1.0.1] - 2026-04-24 ### Fixed - Bug fix description -
提交更改
git add . git commit -m "chore: bump version to 1.0.1" git push -
创建并推送 tag
git tag 1.0.1 git push origin 1.0.1 -
GitHub Actions 自动创建 Release
- release.yml workflow 会自动触发
- 构建插件
- 创建 GitHub Release(草稿)
- 上传文件
-
编辑 Release
- 进入 GitHub Releases
- 编辑草稿 release
- 添加发布说明
- 发布
版本号规范
遵循 语义化版本:
- MAJOR (x.0.0): 不兼容的 API 变更
- MINOR (0.x.0): 向后兼容的新功能
- PATCH (0.0.x): 向后兼容的 bug 修复
示例:
1.0.0→1.0.1: 修复了一个 bug1.0.1→1.1.0: 添加了新功能1.1.0→2.0.0: 重大变更,可能不兼容旧版本
发布检查清单
在发布前确认:
- 所有测试通过 (
npm run test) - 构建成功 (
npm run build) - Lint 检查通过 (
npm run lint) - 在 Obsidian 中测试过
- 更新了 CHANGELOG.md
- README.md 是最新的
故障排除
Workflow 失败
测试失败:
npm run test
修复失败的测试后重试。
构建失败:
npm run build
确保本地构建成功。
权限错误:
- 检查仓库设置 → Actions → General → Workflow permissions
- 选择 "Read and write permissions"
Tag 已存在
# 删除本地 tag
git tag -d 1.0.1
# 删除远程 tag
git push origin :refs/tags/1.0.1
# 重新创建
git tag 1.0.1
git push origin 1.0.1
首次发布到 Obsidian 社区
完成首次 release 后:
- Fork obsidian-releases
- 编辑
community-plugins.json,添加:{ "id": "git-file-push", "name": "Git File Push", "author": "tianyao", "description": "Sync individual notes with GitLab or GitHub. Push, pull, and track changes across mobile and desktop with visual diff and conflict resolution.", "repo": "tianyao/git-file-push" } - 创建 Pull Request
- 等待 Obsidian 团队审核