@cycjimmy/semantic-release-action 2.6.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -36
- package/action.yml +6 -1
- package/docs/CHANGELOG.md +26 -0
- package/package.json +6 -3
- package/src/handleOptions.js +6 -2
- package/src/index.js +3 -0
- package/src/inputs.json +2 -1
package/README.md
CHANGED
|
@@ -18,16 +18,16 @@ GitHub Action for [Semantic Release][semantic-url].
|
|
|
18
18
|
```yaml
|
|
19
19
|
steps:
|
|
20
20
|
- name: Checkout
|
|
21
|
-
uses: actions/checkout@
|
|
21
|
+
uses: actions/checkout@v3
|
|
22
22
|
- name: Semantic Release
|
|
23
|
-
uses: cycjimmy/semantic-release-action@
|
|
23
|
+
uses: cycjimmy/semantic-release-action@v3
|
|
24
24
|
env:
|
|
25
25
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
26
26
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
**IMPORTANT**: `GITHUB_TOKEN` does not have the required permissions to operate on protected branches.
|
|
30
|
-
If you are using this action for protected branches, replace `GITHUB_TOKEN` with [Personal Access Token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line). If using the `@semantic-release/git` plugin for protected branches, avoid persisting credentials as part of `actions/checkout@
|
|
30
|
+
If you are using this action for protected branches, replace `GITHUB_TOKEN` with [Personal Access Token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line). If using the `@semantic-release/git` plugin for protected branches, avoid persisting credentials as part of `actions/checkout@v3` by setting the parameter `persist-credentials: false`. This credential does not have the required permission to operate on protected branches.
|
|
31
31
|
|
|
32
32
|
#### Private Packages
|
|
33
33
|
|
|
@@ -43,14 +43,15 @@ then make sure that you configure this in your `package.json` file:
|
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
### Inputs
|
|
46
|
-
|
|
|
47
|
-
|
|
48
|
-
| semantic_version
|
|
49
|
-
|
|
|
50
|
-
|
|
|
51
|
-
|
|
|
52
|
-
|
|
|
53
|
-
|
|
|
46
|
+
| Input Parameter | Required | Description |
|
|
47
|
+
|:-----------------:|:--------:|--------------------------------------------------------------------------------------------------------------------------|
|
|
48
|
+
| semantic_version | false | Specify specifying version range for semantic-release. [[Details](#semantic_version)] |
|
|
49
|
+
| branches | false | The branches on which releases should happen.[[Details](#branches)]<br>Support for **semantic-release above v16**. |
|
|
50
|
+
| branch | false | The branch on which releases should happen.[[Details](#branch)]<br>Only support for **semantic-release older than v16**. |
|
|
51
|
+
| extra_plugins | false | Extra plugins for pre-install. [[Details](#extra_plugins)] |
|
|
52
|
+
| dry_run | false | Whether to run semantic release in `dry-run` mode. [[Details](#dry_run)] |
|
|
53
|
+
| extends | false | Use a sharable configuration [[Details](#extends)] |
|
|
54
|
+
| working_directory | false | Use another working directory for semantic release [[Details](#working_directory)] |
|
|
54
55
|
|
|
55
56
|
#### semantic_version
|
|
56
57
|
> {Optional Input Parameter} Specify specifying version range for semantic-release.<br>If no version range is specified, latest version will be used by default.
|
|
@@ -58,9 +59,9 @@ then make sure that you configure this in your `package.json` file:
|
|
|
58
59
|
```yaml
|
|
59
60
|
steps:
|
|
60
61
|
- name: Checkout
|
|
61
|
-
uses: actions/checkout@
|
|
62
|
+
uses: actions/checkout@v3
|
|
62
63
|
- name: Semantic Release
|
|
63
|
-
uses: cycjimmy/semantic-release-action@
|
|
64
|
+
uses: cycjimmy/semantic-release-action@v3
|
|
64
65
|
with:
|
|
65
66
|
semantic_version: 15.13.28 # It is recommended to specify specifying version range
|
|
66
67
|
# for semantic-release.
|
|
@@ -77,9 +78,9 @@ steps:
|
|
|
77
78
|
```yaml
|
|
78
79
|
steps:
|
|
79
80
|
- name: Checkout
|
|
80
|
-
uses: actions/checkout@
|
|
81
|
+
uses: actions/checkout@v3
|
|
81
82
|
- name: Semantic Release
|
|
82
|
-
uses: cycjimmy/semantic-release-action@
|
|
83
|
+
uses: cycjimmy/semantic-release-action@v3
|
|
83
84
|
with:
|
|
84
85
|
semantic_version: 16
|
|
85
86
|
# you can set branches for semantic-release above v16.
|
|
@@ -123,9 +124,9 @@ See [configuration#branches](https://semantic-release.gitbook.io/semantic-releas
|
|
|
123
124
|
```yaml
|
|
124
125
|
steps:
|
|
125
126
|
- name: Checkout
|
|
126
|
-
uses: actions/checkout@
|
|
127
|
+
uses: actions/checkout@v3
|
|
127
128
|
- name: Semantic Release
|
|
128
|
-
uses: cycjimmy/semantic-release-action@
|
|
129
|
+
uses: cycjimmy/semantic-release-action@v3
|
|
129
130
|
with:
|
|
130
131
|
semantic_version: 15.13.28
|
|
131
132
|
# you can set branch for semantic-release older than v16.
|
|
@@ -148,9 +149,9 @@ Github Action Workflow:
|
|
|
148
149
|
```yaml
|
|
149
150
|
steps:
|
|
150
151
|
- name: Checkout
|
|
151
|
-
uses: actions/checkout@
|
|
152
|
+
uses: actions/checkout@v3
|
|
152
153
|
- name: Semantic Release
|
|
153
|
-
uses: cycjimmy/semantic-release-action@
|
|
154
|
+
uses: cycjimmy/semantic-release-action@v3
|
|
154
155
|
with:
|
|
155
156
|
# You can specify specifying version range for the extra plugins if you prefer.
|
|
156
157
|
extra_plugins: |
|
|
@@ -178,9 +179,9 @@ Release Config:
|
|
|
178
179
|
```yaml
|
|
179
180
|
steps:
|
|
180
181
|
- name: Checkout
|
|
181
|
-
uses: actions/checkout@
|
|
182
|
+
uses: actions/checkout@v3
|
|
182
183
|
- name: Semantic Release
|
|
183
|
-
uses: cycjimmy/semantic-release-action@
|
|
184
|
+
uses: cycjimmy/semantic-release-action@v3
|
|
184
185
|
with:
|
|
185
186
|
dry_run: true
|
|
186
187
|
env:
|
|
@@ -194,37 +195,56 @@ The action can be used with `extends` option to extend an existing [sharable con
|
|
|
194
195
|
```yaml
|
|
195
196
|
steps:
|
|
196
197
|
- name: Checkout
|
|
197
|
-
uses: actions/checkout@
|
|
198
|
+
uses: actions/checkout@v3
|
|
198
199
|
- name: Semantic Release
|
|
199
|
-
uses: cycjimmy/semantic-release-action@
|
|
200
|
+
uses: cycjimmy/semantic-release-action@v3
|
|
200
201
|
with:
|
|
201
202
|
# You can extend an existing shareable configuration.
|
|
203
|
+
# And you can specify version range for the shareable configuration if you prefer.
|
|
202
204
|
extends: |
|
|
203
|
-
@semantic-release/apm-config
|
|
205
|
+
@semantic-release/apm-config@^9.0.0
|
|
206
|
+
@mycompany/override-config
|
|
207
|
+
env:
|
|
208
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
209
|
+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
#### working_directory
|
|
213
|
+
This action run semantic release in the github provided workspace by default. You can override it by setting another working directory.
|
|
214
|
+
|
|
215
|
+
```yaml
|
|
216
|
+
steps:
|
|
217
|
+
- name: Checkout
|
|
218
|
+
uses: actions/checkout@v3
|
|
219
|
+
- name: Semantic Release
|
|
220
|
+
uses: cycjimmy/semantic-release-action@v3
|
|
221
|
+
with:
|
|
222
|
+
# You can select another working directory like a subdirectory for example.
|
|
223
|
+
working_directory: ./code
|
|
204
224
|
env:
|
|
205
225
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
206
226
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
207
227
|
```
|
|
208
228
|
|
|
209
229
|
### Outputs
|
|
210
|
-
|
|
|
211
|
-
|
|
212
|
-
|
|
|
213
|
-
|
|
|
214
|
-
| new_release_major_version | Major version of the new release. (e.g. `1`)
|
|
215
|
-
| new_release_minor_version | Minor version of the new release. (e.g. `3`)
|
|
216
|
-
| new_release_patch_version | Patch version of the new release. (e.g. `0`)
|
|
217
|
-
|
|
|
218
|
-
|
|
|
219
|
-
|
|
|
230
|
+
| Output Parameter | Description |
|
|
231
|
+
|:-------------------------:|-----------------------------------------------------------------------------------------------------------------------------------|
|
|
232
|
+
| new_release_published | Whether a new release was published. The return value is in the form of a string. (`"true"` or `"false"`) |
|
|
233
|
+
| new_release_version | Version of the new release. (e.g. `"1.3.0"`) |
|
|
234
|
+
| new_release_major_version | Major version of the new release. (e.g. `"1"`) |
|
|
235
|
+
| new_release_minor_version | Minor version of the new release. (e.g. `"3"`) |
|
|
236
|
+
| new_release_patch_version | Patch version of the new release. (e.g. `"0"`) |
|
|
237
|
+
| new_release_channel | The distribution channel on which the last release was initially made available (undefined for the default distribution channel). |
|
|
238
|
+
| new_release_notes | The release notes for the new release. |
|
|
239
|
+
| last_release_version | Version of the previous release, if there was one. (e.g. `"1.2.0"`) |
|
|
220
240
|
|
|
221
241
|
#### Using Output Variables:
|
|
222
242
|
```yaml
|
|
223
243
|
steps:
|
|
224
244
|
- name: Checkout
|
|
225
|
-
uses: actions/checkout@
|
|
245
|
+
uses: actions/checkout@v3
|
|
226
246
|
- name: Semantic Release
|
|
227
|
-
uses: cycjimmy/semantic-release-action@
|
|
247
|
+
uses: cycjimmy/semantic-release-action@v3
|
|
228
248
|
id: semantic # Need an `id` for output variables
|
|
229
249
|
env:
|
|
230
250
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
package/action.yml
CHANGED
|
@@ -23,6 +23,9 @@ inputs:
|
|
|
23
23
|
extends:
|
|
24
24
|
required: false
|
|
25
25
|
description: 'One or several sharable configurations, https://semantic-release.gitbook.io/semantic-release/usage/configuration#extends'
|
|
26
|
+
working_directory:
|
|
27
|
+
required: false
|
|
28
|
+
description: 'Specify another working directory for semantic release. Default one is provided by github.'
|
|
26
29
|
outputs:
|
|
27
30
|
new_release_published:
|
|
28
31
|
description: 'Whether a new release was published'
|
|
@@ -38,6 +41,8 @@ outputs:
|
|
|
38
41
|
description: 'The distribution channel on which the last release was initially made available (undefined for the default distribution channel).'
|
|
39
42
|
new_release_notes:
|
|
40
43
|
description: 'The release notes for the new release.'
|
|
44
|
+
last_release_version:
|
|
45
|
+
description: 'Version of the previous release, if there was one.'
|
|
41
46
|
runs:
|
|
42
|
-
using: '
|
|
47
|
+
using: 'node16'
|
|
43
48
|
main: 'index.js'
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
# [3.1.0](https://github.com/cycjimmy/semantic-release-action/compare/v3.0.0...v3.1.0) (2022-08-05)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* handle versioned extends inputs correctly ([4a51b9f](https://github.com/cycjimmy/semantic-release-action/commit/4a51b9fada7267737750fded8b8edfb275acbbbb))
|
|
7
|
+
|
|
8
|
+
# [3.0.0](https://github.com/cycjimmy/semantic-release-action/compare/v2.7.0...v3.0.0) (2022-03-03)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* switch operating environment to node16 ([b5f16ae](https://github.com/cycjimmy/semantic-release-action/commit/b5f16ae54b21667e3af8a1bd015ec069c8237674)), closes [#92](https://github.com/cycjimmy/semantic-release-action/issues/92) [#96](https://github.com/cycjimmy/semantic-release-action/issues/96)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### BREAKING CHANGES
|
|
17
|
+
|
|
18
|
+
* switch operating environment to node16
|
|
19
|
+
|
|
20
|
+
# [2.7.0](https://github.com/cycjimmy/semantic-release-action/compare/v2.6.0...v2.7.0) (2021-12-12)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Features
|
|
24
|
+
|
|
25
|
+
* add working dir ([7126083](https://github.com/cycjimmy/semantic-release-action/commit/71260837fb05623446dee88dd211f7530838b234))
|
|
26
|
+
|
|
1
27
|
# [2.6.0](https://github.com/cycjimmy/semantic-release-action/compare/v2.5.4...v2.6.0) (2021-10-15)
|
|
2
28
|
|
|
3
29
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cycjimmy/semantic-release-action",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "GitHub Action for Semantic Release",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -21,7 +21,10 @@
|
|
|
21
21
|
},
|
|
22
22
|
"homepage": "https://github.com/cycjimmy/semantic-release-action#readme",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@actions/core": "^1.
|
|
25
|
-
"@cycjimmy/awesome-js-funcs": "^
|
|
24
|
+
"@actions/core": "^1.6.0",
|
|
25
|
+
"@cycjimmy/awesome-js-funcs": "^4.0.4",
|
|
26
|
+
"@semantic-release/changelog": "^6.0.1",
|
|
27
|
+
"@semantic-release/git": "^10.0.1",
|
|
28
|
+
"semantic-release": "^19.0.3"
|
|
26
29
|
}
|
|
27
30
|
}
|
package/src/handleOptions.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const core = require('@actions/core');
|
|
2
|
-
const stringToJson = require('@cycjimmy/awesome-js-funcs/typeConversion/stringToJson').default;
|
|
2
|
+
const stringToJson = require('@cycjimmy/awesome-js-funcs/cjs/typeConversion/stringToJson.cjs').default;
|
|
3
3
|
const inputs = require('./inputs.json');
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -68,7 +68,11 @@ exports.handleExtends = () => {
|
|
|
68
68
|
const extend = core.getInput(inputs.extends);
|
|
69
69
|
|
|
70
70
|
if (extend) {
|
|
71
|
-
|
|
71
|
+
const extendModuleNames = extend.split(/\r?\n/)
|
|
72
|
+
.map((name) => name.replace(/(?<!^)@.+/, ''))
|
|
73
|
+
return {
|
|
74
|
+
extends: extendModuleNames
|
|
75
|
+
};
|
|
72
76
|
} else {
|
|
73
77
|
return {};
|
|
74
78
|
}
|
package/src/index.js
CHANGED
|
@@ -16,6 +16,9 @@ const inputs = require('./inputs.json');
|
|
|
16
16
|
* @returns {Promise<void>}
|
|
17
17
|
*/
|
|
18
18
|
const release = async () => {
|
|
19
|
+
if (core.getInput(inputs.working_directory)) {
|
|
20
|
+
process.chdir(core.getInput(inputs.working_directory));
|
|
21
|
+
}
|
|
19
22
|
await setUpJob();
|
|
20
23
|
await installSpecifyingVersionSemantic();
|
|
21
24
|
await preInstall(core.getInput(inputs.extra_plugins));
|