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
BREAKING CHANGE: The `githubToken` options has been removed. The Github token can now be configured only via the `GH_TOKEN` or `GITHUB_TOKEN` environment variables.
Copy file name to clipboardExpand all lines: README.md
+25-13Lines changed: 25 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,31 +1,35 @@
1
1
# @semantic-release/github
2
2
3
-
Set of [semantic-release](https://github.com/semantic-release/semantic-release) plugins for publishing a [Github release](https://help.github.com/articles/about-releases).
3
+
Set of [semantic-release](https://github.com/semantic-release/semantic-release) plugins for publishing a
|`githubToken`|**Required.** The token used to authenticate with GitHub. |`GH_TOKEN` or `GITHUB_TOKEN` environment variable. |
38
41
|`githubUrl`| The GitHub Enterprise endpoint. |`GH_URL` or `GITHUB_URL` environment variable. |
39
42
|`githubApiPathPrefix`| The GitHub Enterprise API prefix. |`GH_PREFIX` or `GITHUB_PREFIX` environment variable. |
40
43
|`assets`| An array of files to upload to the release. See [assets](#assets). | - |
41
44
42
45
#### `assets`
43
46
44
-
Can be a [glob](https://github.com/isaacs/node-glob#glob-primer) or and `Array` of [globs](https://github.com/isaacs/node-glob#glob-primer) and `Object`s with the following properties
47
+
Can be a [glob](https://github.com/isaacs/node-glob#glob-primer) or and `Array` of
48
+
[globs](https://github.com/isaacs/node-glob#glob-primer) and `Object`s with the following properties
|`path`|**Required.** A [glob](https://github.com/isaacs/node-glob#glob-primer) to identify the files to upload. | - |
49
53
|`name`| The name of the downloadable file on the Github release. | File name extracted from the `path`. |
50
54
|`label`| Short description of the file displayed on the Github release. | - |
51
55
52
-
Each entry in the `assets``Array` is globbed individually. A [glob](https://github.com/isaacs/node-glob#glob-primer) can be a `String` (`"dist/**/*.js"` or `"dist/mylib.js"`) or an `Array` of `String`s that will be globbed together (`["dist/**", "!**/*.css"]`).
56
+
Each entry in the `assets``Array` is globbed individually. A [glob](https://github.com/isaacs/node-glob#glob-primer)
57
+
can be a `String` (`"dist/**/*.js"` or `"dist/mylib.js"`) or an `Array` of `String`s that will be globbed together
58
+
(`["dist/**", "!**/*.css"]`).
53
59
54
60
If a directory is configured, all the files under this directory and its children will be included.
55
61
@@ -59,15 +65,21 @@ Files can be included enven if they have a match in `.gitignore`.
59
65
60
66
`'dist/*.js'`: include all the `js` files in the `dist` directory, but not in its sub-directories.
61
67
62
-
`[['dist', '!**/*.css']]`: include all the files in the `dist` directory and its sub-directories excluding the `css` files.
68
+
`[['dist', '!**/*.css']]`: include all the files in the `dist` directory and its sub-directories excluding the `css`
69
+
files.
63
70
64
-
`[{path: 'dist/MyLibrary.js', label: 'MyLibrary JS distribution'}, {path: 'dist/MyLibrary.css', label: 'MyLibrary CSS distribution'}]`: include the `dist/MyLibrary.js` and `dist/MyLibrary.css` files, and label them `MyLibrary JS distribution` and `MyLibrary CSS distribution` in the Github release.
distribution'}]`: include the `dist/MyLibrary.js` and `dist/MyLibrary.css` files, and label them `MyLibrary JS
73
+
distribution` and `MyLibrary CSS distribution` in the Github release.
65
74
66
-
`[['dist/**/*.{js,css}', '!**/*.min.*'], {path: 'build/MyLibrary.zip', label: 'MyLibrary'}]`: include all the `js` and `css` files in the `dist` directory and its sub-directories excluding the minified version, plus the `build/MyLibrary.zip` file and label it `MyLibrary` in the Github release.
75
+
`[['dist/**/*.{js,css}', '!**/*.min.*'], {path: 'build/MyLibrary.zip', label: 'MyLibrary'}]`: include all the `js` and
76
+
`css` files in the `dist` directory and its sub-directories excluding the minified version, plus the
77
+
`build/MyLibrary.zip` file and label it `MyLibrary` in the Github release.
67
78
68
79
### Usage
69
80
70
-
The plugins are used by default by [semantic-release](https://github.com/semantic-release/semantic-release) so no specific configuration is requiered if `githubToken`, `githubUrl` and `githubApiPathPrefix` are set via environment variable.
81
+
The plugins are used by default by [semantic-release](https://github.com/semantic-release/semantic-release) so no
82
+
specific configuration is required if `githubUrl` and `githubApiPathPrefix` are set via environment variable.
71
83
72
84
Each individual plugin can be disabled, replaced or used with other plugins in the `package.json`:
Copy file name to clipboardExpand all lines: test/helpers/mock-github.js
+13-8Lines changed: 13 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -3,27 +3,32 @@ import nock from 'nock';
3
3
/**
4
4
* Retun a `nock` object setup to respond to a github authentication request. Other expectation and responses can be chained.
5
5
*
6
-
* @param {String} [githubToken='GH_TOKEN'] The github token to return in the authentication response.
7
-
* @param {String} [githubUrl='https://api.github.com'] The url on which to intercept http requests.
8
-
* @param {String} [githubApiPathPrefix] The GitHub Enterprise API prefix.
6
+
* @param {String} [githubToken=process.env.GH_TOKEN || process.env.GITHUB_TOKEN || 'GH_TOKEN'] The github token to return in the authentication response.
7
+
* @param {String} [githubUrl=process.env.GH_URL || process.env.GITHUB_URL || 'https://api.github.com'] The url on which to intercept http requests.
8
+
* @param {String} [githubApiPathPrefix=process.env.GH_PREFIX || process.env.GITHUB_PREFIX || ''] The GitHub Enterprise API prefix.
9
9
* @return {Object} A `nock` object ready to respond to a github authentication request.
* Retun a `nock` object setup to respond to a github release upload request. Other expectation and responses can be chained.
21
21
*
22
-
* @param {String} [githubToken='GH_TOKEN'] The github token to return in the authentication response.
22
+
* @param {String} [githubToken=process.env.GH_TOKEN || process.env.GITHUB_TOKEN || 'GH_TOKEN'] The github token to return in the authentication response.
23
23
* @param {String} [uploadUrl] The url on which to intercept http requests.
24
24
* @return {Object} A `nock` object ready to respond to a github file upload request.
0 commit comments