You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
8
8
9
9
## Usage
10
10
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
-
44
11
### CLI
45
12
46
13
```
@@ -59,13 +26,27 @@ Options:
59
26
-p, --prerelease publish as prerelease [default: false]
Should be run at the root of the project to be released.
65
46
66
47
Expects a `package.json` and `CHANGELOG.md` in the working directory.
67
48
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.
69
50
70
51
## Options
71
52
@@ -84,6 +65,39 @@ All default values taken from `package.json` unless specified otherwise.
84
65
85
66
Override defaults with flags ([cli](#cli)) or the `options` object ([node](#node)).
86
67
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
+
87
101
## Example
88
102
89
103
All [releases](https://github.com/ngoldman/gh-release/releases) of `gh-release` were created with `gh-release`.
0 commit comments