0.4.0 • Published 7 months ago
@yme/git-bump v0.4.0
git-bump
Install
pnpm -g add @yme/git-bump
Usage
git-bump
git bump [options] [release]
# help
git bump [help]
# generate simple changelog
# scope!: breaking changes
# scope: description
# scope?: ignore
# chore: ignore start with chore
git bump changelog [from] [to]
# use server, default is patch
git bump [major, premajor, minor, preminor, patch, prepatch, prerelease]
# custom version
git bump v1.2.3
# single package
git bump [options] [semver]
# bump packages with same version
# packages in the packages/ directory
git bump [options] [semver]
# independent version
# must in a workspace
git bump [options] [semver] --filter=@org/{like,this}
Options
--help print this usage information
--dry run dry mode
--commit commit all changeds default is true
--message= commit message, default is chore(release): v__VERSION__
--tag create a new tag, default is true
--packages= workspace packages, default is packages
--filter= filter packages by package's name
note: use filter in a workspace will enable independent mode
Example
# get tag list and use latest two tag as [from] and [to]
# git --no-pager tag -l --sort=creatordate | awk '{y=x " " $0;x=$0};END{print y}'
git bump changelog v0.3.0 v0.3.1
Output
- **changelog**
- Add origin url to commit hash ([1b9b79e](https://github.com/minosss/git-bump/commit/1b9b79ee64396deb7a409729db0f241cde5e702b))
[v0.3.0...v0.3.1](https://github.com/minosss/git-bump/compare/v0.3.0...v0.3.1)
Use in Github Action
- name: Checkout
uses: actions/checkout@v3
with:
# ensure fetch all history
fetch-depth: 0
# generate changelog and save to body.md
- name: Generate changelog
run: npx @yme/git-bump changelog $(git --no-pager tag -l --sort=creatordate | awk '{y=x " " $0;x=$0};END{print y}') > body.md
# create release with body.md
- name: Create release
uses: ncipollo/release-action@v1
with:
bodyFile: "body.md"
token: ${{ secrets.GITHUB_TOKEN }}