@cycjimmy/semantic-release-action 3.2.0 → 3.3.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 +42 -22
- package/action.yml +3 -0
- package/docs/CHANGELOG.md +7 -0
- package/package.json +2 -2
- package/src/handleOptions.js +16 -0
- package/src/index.js +2 -0
- package/src/inputs.json +2 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
[![semantic-release][semantic-image]][semantic-url]
|
|
6
6
|
[![npm license][license-image]][license-url]
|
|
7
7
|
|
|
8
|
-
GitHub Action for [Semantic Release][semantic-url].
|
|
8
|
+
GitHub Action for [Semantic Release][semantic-url].
|
|
9
9
|
|
|
10
10
|
## Usage
|
|
11
11
|
### Step1: Set any [Semantic Release Configuration](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#configuration) in your repository.
|
|
@@ -45,16 +45,17 @@ then make sure that you configure this in your `package.json` file:
|
|
|
45
45
|
### Inputs
|
|
46
46
|
| Input Parameter | Required | Description |
|
|
47
47
|
|:-----------------:|:--------:|--------------------------------------------------------------------------------------------------------------------------|
|
|
48
|
-
| semantic_version | false | Specify
|
|
48
|
+
| semantic_version | false | Specify version range for semantic-release. [[Details](#semantic_version)] |
|
|
49
49
|
| branches | false | The branches on which releases should happen.[[Details](#branches)]<br>Support for **semantic-release above v16**. |
|
|
50
50
|
| branch | false | The branch on which releases should happen.[[Details](#branch)]<br>Only support for **semantic-release older than v16**. |
|
|
51
51
|
| extra_plugins | false | Extra plugins for pre-install. [[Details](#extra_plugins)] |
|
|
52
52
|
| dry_run | false | Whether to run semantic release in `dry-run` mode. [[Details](#dry_run)] |
|
|
53
53
|
| extends | false | Use a sharable configuration [[Details](#extends)] |
|
|
54
54
|
| working_directory | false | Use another working directory for semantic release [[Details](#working_directory)] |
|
|
55
|
+
| tag_format | false | Specify format of tag (useful for monorepos) |
|
|
55
56
|
|
|
56
57
|
#### semantic_version
|
|
57
|
-
> {Optional Input Parameter} Specify
|
|
58
|
+
> {Optional Input Parameter} Specify version range for semantic-release.
|
|
58
59
|
|
|
59
60
|
```yaml
|
|
60
61
|
steps:
|
|
@@ -63,14 +64,17 @@ steps:
|
|
|
63
64
|
- name: Semantic Release
|
|
64
65
|
uses: cycjimmy/semantic-release-action@v3
|
|
65
66
|
with:
|
|
66
|
-
semantic_version:
|
|
67
|
-
|
|
67
|
+
semantic_version: 19.0.5 # It is recommended to specify a version range
|
|
68
|
+
# for semantic-release when using
|
|
69
|
+
# semantic-release-action lower than @v3
|
|
68
70
|
env:
|
|
69
71
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
70
72
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
71
73
|
```
|
|
72
74
|
|
|
73
|
-
|
|
75
|
+
If no version range is specified with `cycjimmy/semantic-release-action@v3` then [semantic-release](https://github.com/semantic-release/semantic-release/) version [19.0.5](https://github.com/semantic-release/semantic-release/releases/tag/v19.0.5) is used. Earlier versions of `cycjimmy/semantic-release-action` default to using the latest version of [semantic-release](https://github.com/semantic-release/semantic-release/), so in this case it is recommended to specify version 19 or lower to avoid compatibility issues.
|
|
76
|
+
|
|
77
|
+
*Note: [Version 20.0.0](https://github.com/semantic-release/semantic-release/releases/tag/v20.0.0) of [semantic-release](https://github.com/semantic-release/semantic-release/) and later is currently incompatible with `cycjimmy/semantic-release-action`, since it requires Node.js 18. GitHub does not provide this environment yet for [JavaScript actions](https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-javascript-actions).*
|
|
74
78
|
|
|
75
79
|
#### branches
|
|
76
80
|
> {Optional Input Parameter} The branches on which releases should happen.<br>`branches` supports for **semantic-release above v16**.
|
|
@@ -84,18 +88,18 @@ steps:
|
|
|
84
88
|
with:
|
|
85
89
|
semantic_version: 16
|
|
86
90
|
# you can set branches for semantic-release above v16.
|
|
87
|
-
branches: |
|
|
91
|
+
branches: |
|
|
88
92
|
[
|
|
89
93
|
'+([0-9])?(.{+([0-9]),x}).x',
|
|
90
|
-
'master',
|
|
91
|
-
'next',
|
|
92
|
-
'next-major',
|
|
94
|
+
'master',
|
|
95
|
+
'next',
|
|
96
|
+
'next-major',
|
|
93
97
|
{
|
|
94
|
-
name: 'beta',
|
|
98
|
+
name: 'beta',
|
|
95
99
|
prerelease: true
|
|
96
|
-
},
|
|
100
|
+
},
|
|
97
101
|
{
|
|
98
|
-
name: 'alpha',
|
|
102
|
+
name: 'alpha',
|
|
99
103
|
prerelease: true
|
|
100
104
|
}
|
|
101
105
|
]
|
|
@@ -104,14 +108,14 @@ steps:
|
|
|
104
108
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
105
109
|
```
|
|
106
110
|
|
|
107
|
-
`branches` will override the `branches` attribute in your configuration file. If the attribute is not configured on both sides, the default is:
|
|
111
|
+
`branches` will override the `branches` attribute in your configuration file. If the attribute is not configured on both sides, the default is:
|
|
108
112
|
```
|
|
109
113
|
[
|
|
110
114
|
'+([0-9])?(.{+([0-9]),x}).x',
|
|
111
|
-
'master',
|
|
112
|
-
'next',
|
|
113
|
-
'next-major',
|
|
114
|
-
{name: 'beta', prerelease: true},
|
|
115
|
+
'master',
|
|
116
|
+
'next',
|
|
117
|
+
'next-major',
|
|
118
|
+
{name: 'beta', prerelease: true},
|
|
115
119
|
{name: 'alpha', prerelease: true}
|
|
116
120
|
]
|
|
117
121
|
```
|
|
@@ -139,9 +143,9 @@ steps:
|
|
|
139
143
|
It will override the `branch` attribute in your configuration file. If the attribute is not configured on both sides, the default is `master`.
|
|
140
144
|
|
|
141
145
|
#### extra_plugins
|
|
142
|
-
> {Optional Input Parameter} Extra plugins for pre-install.
|
|
146
|
+
> {Optional Input Parameter} Extra plugins for pre-install.
|
|
143
147
|
|
|
144
|
-
The action can be used with `extra_plugins` option to specify plugins which are not in the [default list of plugins of semantic release](https://semantic-release.gitbook.io/semantic-release/usage/plugins#default-plugins). When using this option, please make sure that these plugins are also mentioned in your [semantic release config's plugins](https://semantic-release.gitbook.io/semantic-release/usage/configuration#plugins) array.
|
|
148
|
+
The action can be used with `extra_plugins` option to specify plugins which are not in the [default list of plugins of semantic release](https://semantic-release.gitbook.io/semantic-release/usage/plugins#default-plugins). When using this option, please make sure that these plugins are also mentioned in your [semantic release config's plugins](https://semantic-release.gitbook.io/semantic-release/usage/configuration#plugins) array.
|
|
145
149
|
|
|
146
150
|
For example, if you want to use `@semantic-release/git` and `@semantic-release/changelog` extra plugins, these must be added to `extra_plugins` in your actions file and `plugins` in your [release config file](https://semantic-release.gitbook.io/semantic-release/usage/configuration#configuration-file) as shown bellow:
|
|
147
151
|
|
|
@@ -155,7 +159,7 @@ steps:
|
|
|
155
159
|
with:
|
|
156
160
|
# You can specify specifying version range for the extra plugins if you prefer.
|
|
157
161
|
extra_plugins: |
|
|
158
|
-
@semantic-release/changelog@
|
|
162
|
+
@semantic-release/changelog@6.0.0
|
|
159
163
|
@semantic-release/git
|
|
160
164
|
env:
|
|
161
165
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -226,6 +230,22 @@ steps:
|
|
|
226
230
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
227
231
|
```
|
|
228
232
|
|
|
233
|
+
#### tag_format
|
|
234
|
+
The default tag format on semantic-release is `v{version}`. You can override that behavior using this option (helpful when you are using monorepos)
|
|
235
|
+
|
|
236
|
+
```yaml
|
|
237
|
+
steps:
|
|
238
|
+
- name: Checkout
|
|
239
|
+
uses: actions/checkout@v3
|
|
240
|
+
- name: Semantic Release
|
|
241
|
+
uses: cycjimmy/semantic-release-action@v3
|
|
242
|
+
with:
|
|
243
|
+
tag_format: custom-v{version}
|
|
244
|
+
env:
|
|
245
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
246
|
+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
247
|
+
```
|
|
248
|
+
|
|
229
249
|
### Outputs
|
|
230
250
|
| Output Parameter | Description |
|
|
231
251
|
|:-------------------------:|-----------------------------------------------------------------------------------------------------------------------------------|
|
|
@@ -253,7 +273,7 @@ steps:
|
|
|
253
273
|
env:
|
|
254
274
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
255
275
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
256
|
-
|
|
276
|
+
|
|
257
277
|
- name: Do something when a new release published
|
|
258
278
|
if: steps.semantic.outputs.new_release_published == 'true'
|
|
259
279
|
run: |
|
package/action.yml
CHANGED
|
@@ -26,6 +26,9 @@ inputs:
|
|
|
26
26
|
working_directory:
|
|
27
27
|
required: false
|
|
28
28
|
description: 'Specify another working directory for semantic release. Default one is provided by github.'
|
|
29
|
+
tag_format:
|
|
30
|
+
required: false
|
|
31
|
+
description: 'The default tag format on semantic-release is v{version}. You can override that behavior using this option.'
|
|
29
32
|
outputs:
|
|
30
33
|
new_release_published:
|
|
31
34
|
description: 'Whether a new release was published'
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [3.3.0](https://github.com/cycjimmy/semantic-release-action/compare/v3.2.0...v3.3.0) (2023-03-07)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* support for option tagFormat ([ed38eb0](https://github.com/cycjimmy/semantic-release-action/commit/ed38eb0e9938eefc792510a75ec48d80fead9b21))
|
|
7
|
+
|
|
1
8
|
# [3.2.0](https://github.com/cycjimmy/semantic-release-action/compare/v3.1.2...v3.2.0) (2022-11-04)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cycjimmy/semantic-release-action",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"description": "GitHub Action for Semantic Release",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@actions/core": "^1.10.0",
|
|
25
25
|
"@cycjimmy/awesome-js-funcs": "^4.0.4",
|
|
26
|
-
"@semantic-release/changelog": "^6.0.
|
|
26
|
+
"@semantic-release/changelog": "^6.0.2",
|
|
27
27
|
"@semantic-release/git": "^10.0.1",
|
|
28
28
|
"semantic-release": "^19.0.5"
|
|
29
29
|
}
|
package/src/handleOptions.js
CHANGED
|
@@ -77,3 +77,19 @@ exports.handleExtends = () => {
|
|
|
77
77
|
return {};
|
|
78
78
|
}
|
|
79
79
|
};
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Handle TagFormat Option
|
|
83
|
+
* @returns {{}|{tagFormat: String}}
|
|
84
|
+
*/
|
|
85
|
+
exports.handleTagFormat = () => {
|
|
86
|
+
const tagFormat = core.getInput(inputs.tag_format);
|
|
87
|
+
|
|
88
|
+
if (tagFormat) {
|
|
89
|
+
return {
|
|
90
|
+
tagFormat
|
|
91
|
+
};
|
|
92
|
+
} else {
|
|
93
|
+
return {};
|
|
94
|
+
}
|
|
95
|
+
};
|
package/src/index.js
CHANGED
|
@@ -3,6 +3,7 @@ const {
|
|
|
3
3
|
handleBranchesOption,
|
|
4
4
|
handleDryRunOption,
|
|
5
5
|
handleExtends,
|
|
6
|
+
handleTagFormat,
|
|
6
7
|
} = require('./handleOptions');
|
|
7
8
|
const setUpJob = require('./setUpJob.task');
|
|
8
9
|
const installSpecifyingVersionSemantic = require('./installSpecifyingVersionSemantic.task');
|
|
@@ -29,6 +30,7 @@ const release = async () => {
|
|
|
29
30
|
...handleBranchesOption(),
|
|
30
31
|
...handleDryRunOption(),
|
|
31
32
|
...handleExtends(),
|
|
33
|
+
...handleTagFormat()
|
|
32
34
|
});
|
|
33
35
|
|
|
34
36
|
await cleanupNpmrc();
|