Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add commit rules #136

Closed
wants to merge 2 commits into from

Conversation

zuowendong
Copy link
Collaborator

@zuowendong zuowendong commented Feb 5, 2024

关联 issue #89

实现

使用 commitlint/clihusky 实现commit-msg格式的校验

安装的依赖

pnpm add -Dw @commitlint/cli @commitlint/config-conventional husky

使用 semantic-release 实现 changelog 的自动生成,调研了相关changelog的生成插件:

  1. changesets 活跃度不够,维护情况堪忧
  2. Conventional Changelog 官方自己都不推荐了
  3. standard-version
  4. semantic-release

安装的相关依赖

pnpm add -Dw semantic-release @semantic-release/changelog @semantic-release/git @semantic-release/github @semantic-release/npm @semantic-release/release-notes-generator

semantic-release 配合 GitHub action 实现 CI 自动更新版本,生成changelog...

这需要 Actions secrets,暂无权限

我在自己仓库分支自测,可以实现自动生成changelog

image

image

注意

文件.releaserc.jsbranches 需要指定在哪个分支下要执行发布操作

文件release.yml 中需要push的branches,也需要修改成指定的分支

merge 的代码中均是我在自己的chore/commitRule分支

@cuixiaorui
Copy link
Contributor

这里我们通过命令来手动生成就可

后面需要把 release 的过程封装成 cli

类似 https://github.com/vuejs/core/blob/main/scripts/release.js

@cuixiaorui
Copy link
Contributor

done

  1. 采用 simple-git-hooks 作为 git hooks 的方案 更轻量级
  2. 采用 conventional-changelog 生成 changelog 可以通过脚本控制

@cuixiaorui cuixiaorui closed this Feb 28, 2024
@zuowendong zuowendong deleted the chore/commitRule branch April 25, 2024 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants