1.0.3 • Published 7 years ago
githubrelease v1.0.3
githubrelease
CLI tool for GitHub release management.
What does this do?
- pull from remote origin for master and develop branches
- rebase master onto develop
- rebase develop onto master
- grabs the short SHA of master
- updates changelog
- bumps version number
- commits changes
- creates a version tag
- pushes master and tag to remote
- rebase master onto develop
- pushes develop to remote
- creates a release on github
- output message "Landed in "
Setup
Install
To install from npm:
npm install -g githubreleaseTo install from GitHub:
npm install -g psyrendust/githubreleasePrerequisites
The githubrelease cli uses conventional-github-releaser under the hood, which needs the following in order to work:
- Setup a new GitHub app token
- Set your environment variable
CONVENTIONAL_GITHUB_RELEASER_TOKENto the token you just created
You can find more details here: Setup token for cli.
Usage
Flag options
-h: Show this message.-v: Display the version of this script.-f: Display the flags used when showing config.-l: Generate a changelog entry and save it to<changelog>.-p: Push<master>,<develop>, and tags to<remote>.-u: Update<master>and<develop>branches from<remote>using rebase.-n: Do not display any prompts.-t: Do not trash thenode_modulesfolder before running npm run test.-T: Do not create a git tag and do no run conventionalGithubReleaser.
Argument options
-c: Location of the<changelog>. Defaults toCHANGELOG.md.-C: The NPM client to use. Defaults tonpm.-m: The<master>branch. Defaults tomaster.-d: The<develop>branch. Defaults todevelop.-r: The<remote>push and pull from. Defaults toorigin.-P: The preset style used to generate the changelog. Examples includeangular|jquery.... Defaults to conventional-recommended-bump.-s: Allows you to start at a specific step. Useful for when the script fails before completing all steps. See Available steps below.-b: The semver you would like to use for the release (default: patch). Can be: major | minor | patch | v0.0.0
Available steps
- Update
<master>and<develop>branches from<remote>using rebase. - Push
<master>,<develop>, and tags to<remote>. - Run
npm test - Rebase
<develop>onto<master>. - Make a copy of
package.jsonto_package.json(also copypackage-lock.jsonto_package-lock.jsonif it exists). - Temporarily bump the semver of
package.json. - Save a changelog entry to
<changelog>. - Commit
<changelog>update to Git. - Reset
package.jsonby moving_package.jsontopackage.json(also reset_package-lock.jsontopackage-lock.jsonif it exists). - Run
npm versioncommand, which bumpspackage.jsonand creates a tag. No git tag will be created if-Tis passed. - Rebase
<master>onto<develop>. - Push
<master>,<develop>, and tags to<remote>. - Run conventional-github-releaser to create a release in GitHub.
- Output landed message which contains the short sha of HEAD.
Examples:
- Update all branches
- Push changes from all branches
- Cut a release
githubrelease -u
githubrelease -p
githubrelease -b patch
githubrelease -tTb minorOr just do it all in one command.
githubrelease -b patchUse yarn instead of npm:
githubrelease -b patch -C yarn