#semver #conventional-commits #git #版本控制 #git 仓库

bin+lib conventional-semver-rs

基于常规提交的 Git 项目语义版本管理的 CLI 和库

2 个不稳定版本

0.2.0 2022 年 10 月 14 日
0.1.0 2022 年 10 月 7 日

#1842开发工具

MIT 许可证

27KB
501

传统语义版本

闪电般快速 🚀 的 CLI 工具,用于根据常规提交和 Git 标签确定给定仓库的下一个语义版本。

⚠️ 这处于非常早期的开发阶段。我不建议您将此工具集成到您的项目中。

使用方法

USAGE:
    conver [OPTIONS] [PATH]

ARGS:
    <PATH>    Path to target git repository [default: .]

OPTIONS:
    -f, --bump-files    Bump the version files with the derived version
    -h, --help          Print help information
    -r, --release       Generate final release version
    -t, --tag           Tag the current commit with the release version
    -v, --lead-v        Add an optional leading v to the generated version i.e. (v2.1.3)
    -V, --version       Print version information

配置

conventional-semver-rs 将在仓库目录的根目录中查找一个 conventional_release.toml 文件。当生成版本更新文件时,将应用此配置。如果未找到 conventional_release.toml,则将加载默认配置。

默认配置

v = false

[commit_signature]
name = "conventional-semver-rs"
email = "[email protected]"

配置选项

v = false # Include optional prefix v in generated version

# Customize the commit signature when bumping files and creating tags
[commit_signature]
name = "conventional-semver-rs"
email = "[email protected]"

# Describes a file containing the application's version to be updated on release
[[version_files]]
v = true # Configure option prefix v for version file
path = "version.txt" # Relative path to file
version_prefix = "" # Token to match before the version
version_postfix = "" # Token to match after the version

# Cargo.toml example
[[version_files]]
v = false
path = "Cargo.toml"
version_prefix = "version = \""
version_postfix = "\"[^,]"

# Preset example
# presets are for common version files,
# so you don't have to write the regex!
[[version_files]]
preset = "package.json"
# Currently Supported Presets
# - "Cargo.toml"
# - "package.json"

预发布版本

当以下条件之一为真时,将生成预发布版本。

  • 当前的提交没有标记。 (参见下面的“重建发布标记”。)
  • 未指定 --release 选项。
  • 结构为 {MAJOR}.{MINOR}.{PATCH}-{COMMITS_SINCE_TAG}-{COMMIT_HASH}
    • 示例: 0.3.0-2-g3229751

发布版本

当以下任一条件为真时,将生成发布版本。

  • 当前的提交已经标记为发布版本。
  • 指定了 --release 选项。
  • 结构如下:{MAJOR}.{MINOR}.{PATCH}
    • 示例:0.3.0

依赖项

约17MB
约382K SLoC