Skip to content

Massive Refactor (part II) 🍻 - WIP #85

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Sep 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"presets": ["es2015"],
"env": {
"test": {
"plugins": ["istanbul"]
}
}
}
2 changes: 2 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
codecov:
branch: master
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,5 @@ rules:
array: false
prefer-spread: error
prefer-rest-params: error
prefer-promise-reject-errors: 0
valid-typeof: 0
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
.DS_Store
.nyc_output
node_modules/
npm-debug.log
docs/_site
docs/.sass-cache
coverage
dist
bin
test/**.js.xml
2 changes: 1 addition & 1 deletion .jsdoc.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"dictionaries": ["jsdoc"]
},
"source": {
"include": ["src", "package.json", "README.md"],
"include": ["lib/src", "package.json", "README.md"],
"includePattern": ".js$",
"excludePattern": "(node_modules/|docs)"
},
Expand Down
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
lib/
docs/
tasks/
test/
coverage/
node_modules/
gulpfile.js
.grenrc
Expand Down
9 changes: 7 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,19 @@ language:
- node_js

node_js:
- "5.1"
- "7.9"

cache:
directories:
- node_modules

before_install:
- npm install -g gulp-cli
- npm install -g codecov
- npm install -g mocha

script:
- gulp test
- npm run coverage

after_success:
- codecov
181 changes: 162 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,109 @@
# Github Release Notes
# `gren` 🤖
> Github release notes and changelog generator

[![npm version](https://badge.fury.io/js/github-release-notes.svg)](https://badge.fury.io/js/github-release-notes)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com)
[![Build Status](https://travis-ci.org/github-tools/github-release-notes.svg?branch=master)](https://travis-ci.org/github-tools/github-release-notes)
[![Join the chat at https://gitter.im/github-release-notes/Lobby](https://badges.gitter.im/github-release-notes/Lobby.svg)](https://gitter.im/github-release-notes/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Codecov](https://codecov.io/gh/github-tools/github-release-notes/branch/second-refactor/graph/badge.svg)](https://codecov.io/gh/github-tools/github-release-notes/)
[![npm downloads](https://img.shields.io/npm/dy/github-release-notes.svg)](https://www.npmjs.com/package/github-release-notes)

> Node module that generates release notes based on commit messages or closed issues between tags. It also can create a full changelog or add the latest release notes to the existing changelog file.
## Motivation

If you want to include it in a task, you can use [grunt-github-release-notes](https://github.com/github-tools/grunt-github-release-notes)
Everyone loves neat, transparent, informative release notes.

Everyone would also rather avoid maintaining them. What a hassle to have to evaluate what issues have been solved between two points in project's timeline, what types of problems they were, are they important to inform the users about, what issues solved them etc.

Wouldn't it be great to get fantastic release notes compiled for you automaticaly based on all the hard work you put into your GitHub issues and pull requests.

## OK, what can `gren` do for me?

`gren` is a small helpful robot that will do for you just that! To put simply, it can create a release from a tag and compile the release notes using issues or commits.

It also can generate a `CHANGELOG.md` file based on the release notes (or generate a brand new).

- [The Concept](#the-concept)
- [Feed 🤖](#feed-gren-)
- [Installation](#installation)
- [Basic Usage](#basic-usage)
- [Configuration file](#configuration-file)
- [Full Documentation](https://github-tools.github.io/github-release-notes)

## The Concept

The main motivation for bringing `gren` to life was the need for auto generating release notes for every tag in a project.
The process, [as explained here](https://help.github.com/articles/creating-releases/), requires to go to your project's releases page in GitHub, draft that tag as a new release and manually add what I remembered has changed.

Let `gren` take care of that for you. It automates this process and also writes release notes for you, creating something like this:

> ## v0.6.0 (14/03/2017)
>
> #### Framework Enhancements:
>
> - [#32](https://github.com/github-tools/github-release-notes/issues/32) Unwrap github-api promises
> - [#26](https://github.com/github-tools/github-release-notes/issues/26) Use external config file
> - [#23](https://github.com/github-tools/github-release-notes/issues/23) Introduce templates for the issues
> - [#19](https://github.com/github-tools/github-release-notes/issues/19) Add an "ignore label" flag
> - [#12](https://github.com/github-tools/github-release-notes/issues/12) Add the chance to rebuild the history of release notes
>
> #### Bug Fixes:
>
> - [#29](https://github.com/github-tools/github-release-notes/issues/29) Remove escaping character on regex
> - [#24](https://github.com/github-tools/github-release-notes/issues/24) The changelog action doesn't compile latest release

_(yes, this is one of_ 🤖 _'s actual releases)_

## Feed `gren` 🤖

Where is the data coming from? There are two options:

### `issues` (⭐)

If you manage your project with issues, that's where all the information about a change are.
Issue labels increase the level of depth of what the release notes should show, helping `gren` to group the notes.

_e.g. if you see the example above, the issues are grouped by the two labels `enhancement` and `bug`, then customised via a config file._

`gren` generates those notes by collecting all the issues closed between a tag (defaults to latest) and the tag before it (or a tag that you specify).
If you want to be more accurate on the issues that belong to a release, you can group them in [milestones](https://github-tools.github.io/github-release-notes/examples.html#milestones) and use only the issues that belong to that Milestone.

> The output above is a result of release notes built from issues.

#### Help 🤖 to write wondeful stuff (issues)

In order to have spliendid generated release notes, we reccomend to follow these convensions:

1. Start the title with a verb (e.g. Change header styles)
2. Use the imperative mood in the title (e.g. Fix, not Fixed or Fixes header styles)
3. Use labels wisely and assign one label per issue. `gren` has the [option to ignore issues](#) _(alex: put link to options)_ that have a specified issues.

### `commits`

The simplest way of getting data is from the commits you write.
Even though it doesn't require a machine-readable commit, still would be better to have them in a nice format.

The output would then use commit messages (title + description) to look something like:

> ## v0.9.0 (17/05/2017)
>
> - Filter milestones (#75)
> * Create milestones data-source option
> * Add documentation for the milestones option
> - Support GitHub enterprise (#73)
> * Support GitHub enterprise
> * Add api-url to options documentation
> - Update CHANGELOG.md

#### Help 🤖 to write wondeful stuff (commits)

In order to have spliendid generated release notes, we reccomend to follow these convensions:

1. Start the subject line with a verb (e.g. Change header styles)
2. Use the imperative mood in the subject line (e.g. Fix, not Fixed or Fixes header styles)
3. Limit the subject line to about 50 characters
4. Do not end the subject line with a period
5. Separate subject from body with a blank line
6. Wrap the body at 72 characters
7. Use the body to explain _what_ and _why_ not _how_

## Installation

Expand All @@ -17,43 +113,90 @@ Install `github-release-notes` via npm:
npm install github-release-notes -g
```

## Setup
### Setup

First generate a `github token` at [this link](https://help.github.com/articles/creating-an-access-token-for-command-line-use/). _You only need "repo" scope._
Then add this to `~/.bash_profile` or `~/.zshrc`):
First, generate a `GitHub token`, _with **repo** scope_, at [this link](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/).
Then add this line to `~/.bash_profile` (or `~/.zshrc`):

```shell
export GREN_GITHUB_TOKEN=your_token_here
```

## Basic Usage

`gren` gets the repo information directly from the folder where `git` is initialised.

```shell
# Navigate to your project directory
cd ~/Path/to/repo
# Run the task
gren
# Run the task (see below)
gren release
```

Otherwise, you can run it _anywhere_ passing the repo information:

```shell
gren release --username=[username] --repo=[repo name]
```

Otherwise, you can run it anywhere passing the repo information:
If you don't want to save the token, you can specify one as an option:

```shell
gren --username=[username] --repo=[repo name]
gren release --token=[your token]
```

To use a specific token you can specify it as option:
### [See all the options here](https://github-tools.github.io/github-release-notes/options.html)

### Commands

There are two main commands that can be ran with 🤖:

#### `gren release`

`gren` will look for the latest tag, draft a new release using the issues closed between when that tag and the one before were created and publish that release in your **release** panel in your GitHub repo. ([@see how to feed 🤖](#feed-gren-)).

#### `gren changelog`

Create a `CHANGELOG.md` file using all the release notes of the repo _(like the ones generated by_ 🤖 _)._
If the file exists already, use the `--override` option to proceed.

```shell
gren --token=[your token]
gren changelog --override
```

### Demo
To generate a brand new release notes, using the same approach as per the releases, you have to run the command with the `--generate` option.

```shell
gren changelog --generate
```

### Help! 🆘

`gren` is using [Commander.js](https://github.com/tj/commander.js) which generates the `--help` section.
To trigger the help of a command, run:

```shell
# General usage
gren --help
# Command usage
gren help release # or gren release --help
```

It's also possible to see all the examples [here](https://github-tools.github.io/github-release-notes/examples.html) or directly in the terminal:

```shell
gren examples release
```

![gren demo](./docs/images/examples/exec_gren.gif)
## Configuration file

### Actions
You can create a configuration file where the task will be ran, where to specify your options. [See how to set up the config file](https://github-tools.github.io/github-release-notes/options.html#configuration-file)
The accepted file extensions are the following:

**Gren** has two main usages: `release` and `changelog`.
You can select the action with the `--action` option.
- `.grenrc`
- `.grenrc.json`
- `.grenrc.yml`
- `.grenrc.yaml`
- `.grenrc.js`

[See full documentation here](https://github-tools.github.io/github-release-notes)
### [See full documentation here](https://github-tools.github.io/github-release-notes)
5 changes: 3 additions & 2 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Site settings
title: Github Release Notes
description: > # Node module to publish release notes based on commits between the last two tags.
title: gren
full_title: github release notes
description: Node module to publish release notes based on commits between the last two tags.
baseurl: "/github-release-notes"
docsurl: "github-release-notes/"
url: "http://github-tools.github.io/github-release-notes" # the base hostname & protocol for your site
Expand Down
4 changes: 4 additions & 0 deletions docs/_data/changelog-examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-
name: 'Custom changelog'
description: 'Create a changelog with a custom filename'
code: 'gren changelog --generate --override --changelog-filename=RELEASE_NOTES.md'
10 changes: 10 additions & 0 deletions docs/_data/changelog-options.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
-
short: '-G'
name: generate
description: 'Generate the changelog with gren rather then using the repo releases'
-
short: '-f'
name: changelog-filename
valueType: '<filename.md>'
description: 'The name of the changelog file. [CHANGELOG.md]'
defaultValue: CHANGELOG.md
71 changes: 71 additions & 0 deletions docs/_data/global-options.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
-
short: '-u'
name: username
valueType: '<repo owner>'
description: 'The username of the repo e.g. github-tools'
-
short: '-r'
name: repo
valueType: '<repository name>'
description: 'The repository name e.g. github-release-notes'
-
short: '-T'
name: token
valueType: '<github token>'
description: 'The token generated with repo access'
-
short: '-au'
name: api-url
valueType: '<url>'
description: 'Override the GitHub API URL, allows gren to connect to a private GHE installation'
-
short: '-o'
name: override
description: 'Override the release notes if exist.'
-
short: '-t'
name: tags
valueType: '<new-tag>..<old-tag>'
description: 'Write release notes for <new-tag> using data collected until <old-tag>. If only one tag is specified, will use data until the previous tag. To run gren for all the tags, use --tags=*'
-
short: '-D'
name: data-source
valueType: '<issues|commits|milestones>'
description: 'The informations you want to use to build release notes. [issues]'
defaultValue: issues
-
short: '-im'
name: include-messages
valueType: '<merge|commits|all>'
description: 'Filter the messages added to the release notes. Only used when --data-source used is commits [commits]'
defaultValue: commits
-
short: '-p'
name: prefix
valueType: '<name prefix>'
description: 'Add a prefix to the tag version. e.g. ''v'''
-
short: '-g'
name: group-by
valueType: '<label>'
description: 'Group the issues using the labels as group headings. You can set custom headings for groups of labels from a configuration file.'
-
short: '-L'
name: ignore-labels
valueType: '<label1>,<label2>'
description: 'Ignore the specified labels.'
-
short: '-I'
name: ignore-issues-with
valueType: '<label1>,<label2>'
description: 'Ignore issues that contains one of the specified labels.'
-
short: '-mm'
name: milestone-match
valueType: '<prefix>'
description: 'The title that the script needs to match to link the release to the milestone. e.g. v will match v0.1.0 [Release {{tag_name}}]'
defaultValue: 'Release {{tag_name}}'
-
short: '-m'
name: only-milestones
description: 'Add to the release bodies only the issues that have a milestone'
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy