Skip to content

Commit 6a968a7

Browse files
author
Nate Goldman
committed
Merge pull request #3 from ngoldman/v1.0.7-release
add travis, improve doc, add files
2 parents 395a7f8 + 94fefa6 commit 6a968a7

File tree

4 files changed

+72
-40
lines changed

4 files changed

+72
-40
lines changed

.travis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
language: node_js
2+
3+
node_js:
4+
- "0.10"
5+
6+
script:
7+
- npm test

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# gh-release changelog
22

3+
## 1.0.7 - 2015-02-11
4+
* add `standard` to dev dependencies
5+
* add `.travis.yml` & badge for travis-ci
6+
* improve cli usage info & move to top of readme
7+
* add `files` to `package.json` for future build/zip/dist support
8+
39
## 1.0.6 - 2015-02-08
410
* move `get-defaults.js` to `lib`
511
* improve usage info for cli

README.md

Lines changed: 50 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,13 @@
11
# gh-release
22

3-
Create a release for a node package on github.
3+
[![](https://travis-ci.org/ngoldman/gh-release.svg)](https://travis-ci.org/ngoldman/gh-release)
44

5-
[![](https://nodei.co/npm/gh-release.png)](https://www.npmjs.com/package/gh-release)
5+
Create a release for a node package on github.
66

77
Uses the [Github Releases API](https://developer.github.com/v3/repos/releases/) to create a new release using information from your `package.json` and `CHANGELOG.md`. Has strong defaults, relies on standards.
88

99
## Usage
1010

11-
### Node
12-
13-
```
14-
$ npm install gh-release --save-dev
15-
```
16-
17-
```js
18-
var ghRelease = require('gh-release')
19-
var options = {
20-
tag_name: 'v1.0.0',
21-
target_commitish: 'master',
22-
name: 'v1.0.0',
23-
body: '* init\n',
24-
draft: false,
25-
prerelease: false,
26-
repo: 'gh-release',
27-
owner: 'ngoldman'
28-
}
29-
var auth = {
30-
username: 'ngoldman',
31-
password: 'XXXXXXXX'
32-
}
33-
34-
ghRelease(options, auth, function (err, result) {
35-
if (err) throw err
36-
console.log('Release URL: ' + result)
37-
})
38-
```
39-
40-
All settings in `options` are optional (see [options](#options) for defaults).
41-
42-
`username` and `password` in `auth` are required. Ideally this will support a token in the future as well -- storing these things in plaintext as env vars or anything else is obviously a bad idea. Right now user & pass are mainly there to support the CLI prompt use case.
43-
4411
### CLI
4512

4613
```
@@ -59,13 +26,27 @@ Options:
5926
-p, --prerelease publish as prerelease [default: false]
6027
-h, --help Show help
6128
-v, --version Show version number
29+
30+
$ gh-release
31+
? github username: ngoldman
32+
? github password: *************
33+
{ tag_name: 'v1.0.7',
34+
target_commitish: '395a7f8dfa6fcc961b2dc5c2ced2220e04f9f28a',
35+
name: 'v1.0.7',
36+
body: '* add `standard` to dev dependencies\n* add `.travis.yml` & badge for travis-ci\n* improve cli usage info & move to top of readme\n\n',
37+
owner: 'ngoldman',
38+
repo: 'gh-release',
39+
draft: false,
40+
prerelease: false }
41+
? does this look right? (y/N) y
42+
https://github.com/ngoldman/gh-release/releases/tag/v1.0.7
6243
```
6344

6445
Should be run at the root of the project to be released.
6546

6647
Expects a `package.json` and `CHANGELOG.md` in the working directory.
6748

68-
Prints release URL to terminal on success.
49+
Prints release URL (e.g. https://github.com/ngoldman/gh-release/releases/tag/v1.0.7) to terminal on success.
6950

7051
## Options
7152

@@ -84,6 +65,39 @@ All default values taken from `package.json` unless specified otherwise.
8465

8566
Override defaults with flags ([cli](#cli)) or the `options` object ([node](#node)).
8667

68+
### Node
69+
70+
```
71+
$ npm install gh-release --save-dev
72+
```
73+
74+
```js
75+
var ghRelease = require('gh-release')
76+
var options = {
77+
tag_name: 'v1.0.0',
78+
target_commitish: 'master',
79+
name: 'v1.0.0',
80+
body: '* init\n',
81+
draft: false,
82+
prerelease: false,
83+
repo: 'gh-release',
84+
owner: 'ngoldman'
85+
}
86+
var auth = {
87+
username: 'ngoldman',
88+
password: 'XXXXXXXX'
89+
}
90+
91+
ghRelease(options, auth, function (err, result) {
92+
if (err) throw err
93+
console.log('Release URL: ' + result)
94+
})
95+
```
96+
97+
All settings in `options` are optional (see [options](#options) for defaults).
98+
99+
`username` and `password` in `auth` are required. Ideally this will support a token in the future as well -- storing these things in plaintext as env vars or anything else is obviously a bad idea. Right now user & pass are mainly there to support the CLI prompt use case.
100+
87101
## Example
88102

89103
All [releases](https://github.com/ngoldman/gh-release/releases) of `gh-release` were created with `gh-release`.

package.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "gh-release",
33
"description": "Create a release for a node package on github.",
4-
"version": "1.0.6",
4+
"version": "1.0.7",
55
"author": "Nate Goldman <[email protected]>",
66
"bin": {
77
"gh-release": "./bin/cli.js"
@@ -15,6 +15,14 @@
1515
"shelljs": "^0.3.0",
1616
"yargs": "^2.1.1"
1717
},
18+
"devDependencies": {
19+
"standard": "^2.6.0"
20+
},
21+
"files": [
22+
"bin/",
23+
"lib/",
24+
"index.js"
25+
],
1826
"homepage": "https://github.com/ngoldman/gh-release",
1927
"keywords": [
2028
"github",
@@ -29,8 +37,5 @@
2937
"scripts": {
3038
"gh-release": "node ./bin/cli.js",
3139
"test": "standard"
32-
},
33-
"devDependencies": {
34-
"standard": "^2.6.0"
3540
}
3641
}

0 commit comments

Comments
 (0)