# release-to-github-with-changelog

> Parses CHANGELOG.md to publish a new release resource to the Github api

Latest version **1.2.4** (published 2020-04-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install release-to-github-with-changelog
pnpm add release-to-github-with-changelog
yarn add release-to-github-with-changelog
bun add release-to-github-with-changelog
```

Provides the commands `release-to-github-with-changelog`, `release-to-github-with-changelog-pre-release-checks`.

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.2.4 |
| Published | 2020-04-29 |
| First published | 2016-07-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 580.4 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 4 |
| Author | adrienDog |
| Maintainers | adriendog |
| Keywords | npm, release, github |

## Links

- npm: https://www.npmjs.com/package/release-to-github-with-changelog
- Repository: https://github.com/transferwise/release-to-github-with-changelog
- Homepage: https://github.com/adriendog/release-to-github-with-changelog#readme
- Issues: https://github.com/adriendog/release-to-github-with-changelog/issues
- npm.io page: https://npm.io/package/release-to-github-with-changelog

## Dependencies (5)

- [yargs](https://npm.io/package/yargs.md) ^12.0.2
- [colors](https://npm.io/package/colors.md) ^1.3.2
- [request](https://npm.io/package/request.md) ^2.88.0
- [shelljs](https://npm.io/package/shelljs.md) ^0.8.2
- [request-promise](https://npm.io/package/request-promise.md) ^4.2.2

## Recent versions

- 1.2.4 (latest) — 2020-04-29
- 1.2.3 — 2020-04-29
- 1.2.2 — 2019-02-05
- 1.2.1 — 2018-11-02
- 1.2.0 — 2018-05-24
- 1.1.5 — 2017-09-07
- 1.1.4 — 2017-06-29
- 1.1.3 — 2017-06-01
- 1.1.2 — 2017-06-01
- 1.1.1 — 2017-06-01
- 1.1.0 — 2017-06-01
- 1.0.0 — 2017-06-01
- 0.7.0 — 2017-03-14
- 0.6.1 — 2016-12-19
- 0.6.0 — 2016-12-19
- … 15 more at https://npm.io/package/release-to-github-with-changelog/versions

## README

# release-to-github-with-changelog
[![CircleCI](https://circleci.com/gh/adrienDog/release-to-github-with-changelog.svg?style=shield&circle-token=:9f1c74e21caa562c5e012b5a781d0ce4d15812d2)](https://circleci.com/gh/adrienDog/release-t--github-with-changelog)

[![npm version](https://badge.fury.io/js/release-to-github-with-changelog.svg)](https://badge.fury.io/js/release-to-github-with-changelog)

*Node v6.9.1 is required*

## Goal
Keep the released npm package in sync with the GitHub repo master branch:
- the last `CHANGELOG.md` item is in sync with the last release on Github, with corresponding version tag
- the `package.json` version is in sync with the `master` branch version tag

![alt tag](img/changelog_releases_sync.png)

## Usage
The sources of truth are `CHANGELOG.md` and `package.json`.
Your interface is your `CHANGELOG.md`.
### CHANGELOG.md
Every `CHANGELOG.md` item should represent a release note of the version it describes:
```
# v0.2.0 //version tag
## The release title
// The release description in markdown

# v0.1.9
...
```
#### Full example:
```
# v0.2.0
## We can fly
Great news! The machine can now also fly!

# v0.1.0
## We can move
### What the machine does
It can move, a bit slowly but still it moves.

//...
```
### Export a GITHUB_TOKEN env variable
Either locally with `export GITHUB_TOKEN=$yourToken` or in your CI tool settings (see CircleCI example).

### Example of package.json
Don't forget the `repository.url`. It will be parsed to extract the repository full name (`myOrg/myRepo` in this example).
#### Test tool
You can include a check of your `CHANGELOG.md` format in your test command by using the provided `release-to-github-with-changelog-pre-release-checks` command.
```
{
  "version": "0.2.0",
  "respository": {
    "type": "git",
    "url": "git+https://github.com/myOrg/myRepo.git"
  },
  "files": ["dist"],
  "scripts": {
    "build": // build dist files
    "release": "npm publish && npm run release-to-github-with-changelog",
    "release": "npm publish && npm run release-to-github-with-changelog --branch=releases", // optional branch name
    "test": "release-to-github-with-changelog-pre-release-checks && karma start"
  }
}
```
## CI example
`circle.yml`
```
machine:
  node:
    version: 4.1.0
dependencies:
  pre:
    - echo -e "$NPM_USER\n$NPM_PASS\n$NPM_EMAIL" | npm login
deployment:
  production:
    branch: master
    commands:
      - npm run release
```

---
_Source: https://npm.io/package/release-to-github-with-changelog · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
