simple-github-release
v1.0.0
Published
Simple tool to create GitHub releases.
Downloads
460
Readme
simple-github-release
Simple tool to create GitHub releases. It reads the latest notes from changelog and creates a release on the GitHub repository with them.
Usage
- Install
# yarn
yarn add -D simple-github-release
# pnpm
pnpm add -D simple-github-release
# npm
npm i -D simple-github-release
- Add script to package.json
{
"scripts": {
"release": "simple-github-release"
}
}
- Configure it in package.json
{
"simple-github-release": {
"releaseName": "Release ${version}"
}
}
or create .simple-github-release.js
or .simple-github-release.json
file
export default {
releaseName: 'Release ${version}'
}
or just add options to script
{
"scripts": {
"release": "simple-github-release --ci"
}
}
Create a personal access token and make sure the token is available as an environment variable. Or use
browser
option to create release manually. GitHub will be opened in browser with pre-populated fields.Now you can run it!
pnpm release
Options
| Options | Description | Default |
|---------|-------------|---------|
| titleRegExp | Regular expression to find release title in changelog. Must contain capture group, which will be used to detect release version. As fallback, version will read from package.json. | not required |
| includeTitle | Include release title into release notes. | false
|
| remoteUrl | GitHub repository remote url. | From local environment. |
| host | Custom API host. | 'github.com'
|
| changelogLocation | Path to read changelog file. | 'CHANGELOG.md'
|
| releaseName | Release name to create. You are able to use some placeholders: ${tag}
- latest git tag name, as fallback will used 'v${version}'
; ${version}
- version. | '${tag}'
|
| draft | Create release draft. | false
|
| prerelease | Create pre-release. | false
|
| auto | Create release with automatically generated notes. Changelog file will be ignored. | false
|
| browser | Create link to create release in browser. | !process.env.GITHUB_TOKEN
|
| ci | Do not trigger user interactions. | false
|
Why?
Quick comparison with other tools:
- semantic-release - this tool is intended to be used in CI. It is hard to use locally;
- release-it - has issues with conventional changelog;
- conventional-github-releaser - doesn't have fallback to create release in browser.
Also, all these tools generate release notes from commits, simple-github-release reads notes from an already existing changelog file. For example, you can use standard-version to bump version and generate changelog, and then use simple-github-release to create release on GitHub.