simple-github-release

Simple tool to create GitHub releases.

Usage no npm install needed!

<script type="module">
  import simpleGithubRelease from 'https://cdn.skypack.dev/simple-github-release';
</script>

README

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

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:

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.