A simple tool to create GitHub releases.
npm install simple-github-release[![ESM-only package][package]][package-url]
[![NPM version][npm]][npm-url]
[![Node version][node]][node-url]
[![Dependencies status][deps]][deps-url]
[![Install size][size]][size-url]
[![Build status][build]][build-url]
[![Coverage status][coverage]][coverage-url]
[package]: https://img.shields.io/badge/package-ESM--only-ffe536.svg
[package-url]: https://nodejs.org/api/esm.html
[npm]: https://img.shields.io/npm/v/simple-github-release.svg
[npm-url]: https://www.npmjs.com/package/simple-github-release
[node]: https://img.shields.io/node/v/simple-github-release.svg
[node-url]: https://nodejs.org
[deps]: https://img.shields.io/librariesio/release/npm/simple-github-release
[deps-url]: https://libraries.io/npm/simple-github-release/tree
[size]: https://packagephobia.com/badge?p=simple-github-release
[size-url]: https://packagephobia.com/result?p=simple-github-release
[build]: https://img.shields.io/github/actions/workflow/status/TrigenSoftware/simple-release/tests.yml?branch=main
[build-url]: https://github.com/TrigenSoftware/simple-release/actions
[coverage]: https://coveralls.io/repos/github/TrigenSoftware/simple-release/badge.svg?branch=main
[coverage-url]: https://coveralls.io/github/TrigenSoftware/simple-release?branch=main
A simple tool to create GitHub releases. It reads the latest notes from changelog and creates a release on the GitHub repository with them.
1. Install
``bash`pnpm
pnpm add -D simple-github-releaseyarn
yarn add -D simple-github-releasenpm
npm i -D simple-github-release
2. Add script to package.json
`json`
{
"scripts": {
"release": "simple-github-release"
}
}
3. Configure it in package.json
`json`
{
"simple-github-release": {
"releaseName": "Release ${version}"
}
}
or create .simple-github-release.js or .simple-github-release.json file
`js`
export default {
releaseName: 'Release ${version}'
}
or just add options to script
`json`
{
"scripts": {
"release": "simple-github-release --ci"
}
}
4. 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.
5. Now you can run it!
`bash`
pnpm release
| 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 |'github.com'
| remoteUrl | GitHub repository remote url. | From local environment. |
| host | Custom API host. | |'CHANGELOG.md'
| changelogLocation | Path to read changelog file. | |${tag}
| releaseName | Release name to create. You are able to use some placeholders: - latest git tag name, as fallback will used 'v${version}'; ${version} - version. | '${tag}' |false
| draft | Create release draft. | |false
| prerelease | Create pre-release. | |false
| auto | Create release with automatically generated notes. Changelog file will be ignored. | |!process.env.GITHUB_TOKEN
| browser | Create link to create release in browser. | |false` |
| ci | Do not trigger user interactions. |
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.