Skip to content

持续部署 ​

推荐工作流

  1. 修改代码
  2. 检查当前工作目录代码是否已全部提交
  3. 在 package.json 中更新版本
  4. 生成 CHANGELOG
  5. 提交 package.json 和 CHANGELOG.md 文件
  6. Tag
  7. Push

提交 ​

  1. 检查当前工作目录代码是否已全部提交
  2. 生成 CHANGELOG
sh
changelogen --clean --output CHANGELOG.md

在package.json中确定服务器更改和更新版本。

CHANGELOG ​

Changelog(变更日志)文件记录了软件项目的版本历史以及每个版本中所做的更改。这些更改可能包括新功能、修复的错误、安全增强等等。变更日志可以帮助开发者、用户和维护者了解软件项目的演化历程,以及在不同版本之间进行比较和追踪。在软件项目的开发和维护过程中,变更日志文件也可以作为沟通工具,帮助团队成员之间更好地协作和理解彼此的工作。

模板

feat: { title: "🚀 Enhancements", semver: "minor" },
perf: { title: "🔥 Performance", semver: "patch" },
fix: { title: "🩹 Fixes", semver: "patch" },
refactor: { title: "💅 Refactors", semver: "patch" },
docs: { title: "📖 Documentation", semver: "patch" },
build: { title: "📦 Build", semver: "patch" },
types: { title: "🌊 Types", semver: "patch" },
chore: { title: "🏡 Chore" },
examples: { title: "🏀 Examples" },
test: { title: "✅ Tests" },
style: { title: "🎨 Styles" },
ci: { title: "🤖 CI" },

Tag ​

js
export default {
  templates: {
    commitMessage: 'chore(release): v{{newVersion}}',
    tagMessage: 'v{{newVersion}}',
    tagBody: 'v{{newVersion}}',
  },
}
sh
changelogen --bump --output CHANGELOG.md --release --push
json
{
  "bump:patch": "changelogen --bump --output CHANGELOG.md --release --patch",
  "bump:minor": "changelogen --bump --output CHANGELOG.md --release --minor",
  "bump:major": "changelogen --bump --output CHANGELOG.md --release --major"
}

发布包 ​

sh
npm publish --access public --tag latest
  publish: {
    args?: string[];
    tag?: string;
    private?: boolean;
  };