项目作者: silverwind

项目描述 :
CLI to flexibly increment a project's version
高级语言: JavaScript
项目地址: git://github.com/silverwind/versions.git
创建时间: 2018-09-05T05:18:03Z
项目社区:https://github.com/silverwind/versions

开源协议:BSD 2-Clause "Simplified" License

下载


versions

CLI to flexibly increment a project’s version

Usage

  1. # increment patch version of current project
  2. npx versions patch

Bun and Deno

  1. bunx versions
  2. deno run -A npm:versions

Options

  1. usage: versions [options] patch|minor|major [files...]
  2. Options:
  3. -a, --all Add all changed files to the commit
  4. -b, --base <version> Base version. Default is from latest git tag or 0.0.0
  5. -p, --prefix Prefix version string with a "v" character. Default is none
  6. -c, --command <cmd> Run command after files are updated but before git commit and tag
  7. -d, --date [<date>] Replace dates in format YYYY-MM-DD with current or given date
  8. -m, --message <str> Custom tag and commit message
  9. -r, --replace <str> Additional replacements in the format "s#regexp#replacement#flags"
  10. -g, --gitless Do not perform any git action like creating commit and tag
  11. -D, --dry Do not create a tag or commit, just print what would be done
  12. -v, --version Print the version
  13. -h, --help Print this help
  14. The message and replacement strings accept tokens _VER_, _MAJOR_, _MINOR_, _PATCH_.
  15. Examples:
  16. $ versions patch
  17. $ versions -c 'npm run build' -m 'Release _VER_' minor file.css

Signing commits and tags

To automatically sign commits and tags created by versions with GPG add this to your ~/.gitconfig:

  1. [user]
  2. signingkey = <keyid>
  3. [commit]
  4. gpgSign = true
  5. [tag]
  6. forceSignAnnotated = true
  7. [push]
  8. gpgSign = if-asked

CI environments

CI environments usually do incomplete git checkouts without tags. Fetch tags first:

  1. git fetch --tags --force

© silverwind, distributed under BSD licence