1.0.0 • Published 2 years ago

simple-github-release v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

simple-github-release

NPM version Node version Dependencies status Build status Coverage status

Simple tool to create GitHub releases. It reads the latest notes from changelog and creates a release on the GitHub repository with them.

Usage

  1. Install
# yarn
yarn add -D simple-github-release
# pnpm
pnpm add -D simple-github-release
# npm
npm i -D simple-github-release
  1. Add script to package.json
{
  "scripts": {
    "release": "simple-github-release"
  }
}
  1. 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"
  }
}
  1. 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.

  2. Now you can run it!

pnpm release

Options

OptionsDescriptionDefault
titleRegExpRegular 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
includeTitleInclude release title into release notes.false
remoteUrlGitHub repository remote url.From local environment.
hostCustom API host.'github.com'
changelogLocationPath to read changelog file.'CHANGELOG.md'
releaseNameRelease name to create. You are able to use some placeholders: ${tag} - latest git tag name, as fallback will used 'v${version}'; ${version} - version.'${tag}'
draftCreate release draft.false
prereleaseCreate pre-release.false
autoCreate release with automatically generated notes. Changelog file will be ignored.false
browserCreate link to create release in browser.!process.env.GITHUB_TOKEN
ciDo not trigger user interactions.false

Why?

Quick comparison with other tools:

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.