@cycjimmy/semantic-release-action 3.4.2 → 4.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 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@v3
21
+ uses: actions/checkout@v4
22
22
  - name: Semantic Release
23
- uses: cycjimmy/semantic-release-action@v3
23
+ uses: cycjimmy/semantic-release-action@v4
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@v3` by setting the parameter `persist-credentials: false`. This credential does not have the required permission 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@v4` 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
 
@@ -53,7 +53,8 @@ then make sure that you configure this in your `package.json` file:
53
53
  | ci | false | Whether to run semantic release with CI support. [[Details](#ci)]<br>Support for **semantic-release above v16**. |
54
54
  | extends | false | Use a sharable configuration [[Details](#extends)] |
55
55
  | working_directory | false | Use another working directory for semantic release [[Details](#working_directory)] |
56
- | tag_format | false | Specify format of tag (useful for monorepos) |
56
+ | tag_format | false | Specify format of tag (useful for monorepos) |
57
+ | repository_url | false | The Git repository url. If no repository url specified, current repository will be used by default. |
57
58
 
58
59
  #### semantic_version
59
60
  > {Optional Input Parameter} Specify version range for semantic-release.
@@ -61,21 +62,19 @@ then make sure that you configure this in your `package.json` file:
61
62
  ```yaml
62
63
  steps:
63
64
  - name: Checkout
64
- uses: actions/checkout@v3
65
+ uses: actions/checkout@v4
65
66
  - name: Semantic Release
66
- uses: cycjimmy/semantic-release-action@v3
67
+ uses: cycjimmy/semantic-release-action@v4
67
68
  with:
68
69
  semantic_version: 19.0.5 # It is recommended to specify a version range
69
70
  # for semantic-release when using
70
- # semantic-release-action lower than @v3
71
+ # semantic-release-action lower than @v4
71
72
  env:
72
73
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73
74
  NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
74
75
  ```
75
76
 
76
- 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.
77
-
78
- *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).*
77
+ If no version range is specified with `cycjimmy/semantic-release-action@v4` then [semantic-release](https://github.com/semantic-release/semantic-release/) version [21.1.1](https://github.com/semantic-release/semantic-release/releases/tag/v21.1.1) is used.
79
78
 
80
79
  #### branches
81
80
  > {Optional Input Parameter} The branches on which releases should happen.<br>`branches` supports for **semantic-release above v16**.
@@ -83,9 +82,9 @@ If no version range is specified with `cycjimmy/semantic-release-action@v3` then
83
82
  ```yaml
84
83
  steps:
85
84
  - name: Checkout
86
- uses: actions/checkout@v3
85
+ uses: actions/checkout@v4
87
86
  - name: Semantic Release
88
- uses: cycjimmy/semantic-release-action@v3
87
+ uses: cycjimmy/semantic-release-action@v4
89
88
  with:
90
89
  semantic_version: 16
91
90
  # you can set branches for semantic-release above v16.
@@ -129,9 +128,9 @@ See [configuration#branches](https://semantic-release.gitbook.io/semantic-releas
129
128
  ```yaml
130
129
  steps:
131
130
  - name: Checkout
132
- uses: actions/checkout@v3
131
+ uses: actions/checkout@v4
133
132
  - name: Semantic Release
134
- uses: cycjimmy/semantic-release-action@v3
133
+ uses: cycjimmy/semantic-release-action@v4
135
134
  with:
136
135
  semantic_version: 15.13.28
137
136
  # you can set branch for semantic-release older than v16.
@@ -154,9 +153,9 @@ Github Action Workflow:
154
153
  ```yaml
155
154
  steps:
156
155
  - name: Checkout
157
- uses: actions/checkout@v3
156
+ uses: actions/checkout@v4
158
157
  - name: Semantic Release
159
- uses: cycjimmy/semantic-release-action@v3
158
+ uses: cycjimmy/semantic-release-action@v4
160
159
  with:
161
160
  # You can specify specifying version range for the extra plugins if you prefer.
162
161
  extra_plugins: |
@@ -184,9 +183,9 @@ Release Config:
184
183
  ```yaml
185
184
  steps:
186
185
  - name: Checkout
187
- uses: actions/checkout@v3
186
+ uses: actions/checkout@v4
188
187
  - name: Semantic Release
189
- uses: cycjimmy/semantic-release-action@v3
188
+ uses: cycjimmy/semantic-release-action@v4
190
189
  with:
191
190
  dry_run: true
192
191
  env:
@@ -200,9 +199,9 @@ steps:
200
199
  ```yaml
201
200
  steps:
202
201
  - name: Checkout
203
- uses: actions/checkout@v3
202
+ uses: actions/checkout@v4
204
203
  - name: Semantic Release
205
- uses: cycjimmy/semantic-release-action@v3
204
+ uses: cycjimmy/semantic-release-action@v4
206
205
  with:
207
206
  ci: false
208
207
  env:
@@ -218,9 +217,9 @@ The action can be used with `extends` option to extend an existing [sharable con
218
217
  ```yaml
219
218
  steps:
220
219
  - name: Checkout
221
- uses: actions/checkout@v3
220
+ uses: actions/checkout@v4
222
221
  - name: Semantic Release
223
- uses: cycjimmy/semantic-release-action@v3
222
+ uses: cycjimmy/semantic-release-action@v4
224
223
  with:
225
224
  # You can extend an existing shareable configuration.
226
225
  # And you can specify version range for the shareable configuration if you prefer.
@@ -238,9 +237,9 @@ This action run semantic release in the github provided workspace by default. Yo
238
237
  ```yaml
239
238
  steps:
240
239
  - name: Checkout
241
- uses: actions/checkout@v3
240
+ uses: actions/checkout@v4
242
241
  - name: Semantic Release
243
- uses: cycjimmy/semantic-release-action@v3
242
+ uses: cycjimmy/semantic-release-action@v4
244
243
  with:
245
244
  # You can select another working directory like a subdirectory for example.
246
245
  working_directory: ./code
@@ -255,11 +254,11 @@ The default tag format on semantic-release is `v{version}`. You can override tha
255
254
  ```yaml
256
255
  steps:
257
256
  - name: Checkout
258
- uses: actions/checkout@v3
257
+ uses: actions/checkout@v4
259
258
  - name: Semantic Release
260
- uses: cycjimmy/semantic-release-action@v3
259
+ uses: cycjimmy/semantic-release-action@v4
261
260
  with:
262
- tag_format: custom-v{version}
261
+ tag_format: custom-v${version}
263
262
  env:
264
263
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
265
264
  NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -285,9 +284,9 @@ steps:
285
284
  ```yaml
286
285
  steps:
287
286
  - name: Checkout
288
- uses: actions/checkout@v3
287
+ uses: actions/checkout@v4
289
288
  - name: Semantic Release
290
- uses: cycjimmy/semantic-release-action@v3
289
+ uses: cycjimmy/semantic-release-action@v4
291
290
  id: semantic # Need an `id` for output variables
292
291
  env:
293
292
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
package/action.yml CHANGED
@@ -32,6 +32,9 @@ inputs:
32
32
  tag_format:
33
33
  required: false
34
34
  description: 'The default tag format on semantic-release is v{version}. You can override that behavior using this option.'
35
+ repository_url:
36
+ required: false
37
+ description: 'The Git repository url. If no repository url specified, current repository will be used by default.'
35
38
  outputs:
36
39
  new_release_published:
37
40
  description: 'Whether a new release was published'
@@ -58,5 +61,5 @@ outputs:
58
61
  last_release_git_tag:
59
62
  description: 'The Git tag associated with the last release, if there was one.'
60
63
  runs:
61
- using: 'node16'
64
+ using: 'node20'
62
65
  main: 'index.js'
package/docs/CHANGELOG.md CHANGED
@@ -1,3 +1,27 @@
1
+ # [4.1.0](https://github.com/cycjimmy/semantic-release-action/compare/v4.0.0...v4.1.0) (2024-03-19)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * fix syntax error for importing ([4297675](https://github.com/cycjimmy/semantic-release-action/commit/42976755bc1a5e38051e756e3a2344ea8f354379))
7
+
8
+
9
+ ### Features
10
+
11
+ * add repository_url input ([8dffec4](https://github.com/cycjimmy/semantic-release-action/commit/8dffec4efa886f02052787d688bfccb2e9983b1a))
12
+
13
+ # [4.0.0](https://github.com/cycjimmy/semantic-release-action/compare/v3.4.2...v4.0.0) (2023-08-31)
14
+
15
+
16
+ ### Features
17
+
18
+ * update node version on runner to 20 ([0c20554](https://github.com/cycjimmy/semantic-release-action/commit/0c2055456eeae973aeeb66cf5082061badb3502c))
19
+
20
+
21
+ ### BREAKING CHANGES
22
+
23
+ * set the default node version to 20
24
+
1
25
  ## [3.4.2](https://github.com/cycjimmy/semantic-release-action/compare/v3.4.1...v3.4.2) (2023-03-30)
2
26
 
3
27
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cycjimmy/semantic-release-action",
3
- "version": "3.4.2",
3
+ "version": "4.1.0",
4
4
  "description": "GitHub Action for Semantic Release",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -22,9 +22,9 @@
22
22
  "homepage": "https://github.com/cycjimmy/semantic-release-action#readme",
23
23
  "dependencies": {
24
24
  "@actions/core": "^1.10.0",
25
- "@cycjimmy/awesome-js-funcs": "^4.0.4",
25
+ "@cycjimmy/awesome-js-funcs": "^4.0.9",
26
26
  "@semantic-release/changelog": "^6.0.3",
27
27
  "@semantic-release/git": "^10.0.1",
28
- "semantic-release": "^19.0.5"
28
+ "semantic-release": "^23.0.5"
29
29
  }
30
30
  }
@@ -47,6 +47,7 @@ exports.handleBranchesOption = () => {
47
47
  */
48
48
  exports.handleDryRunOption = () => {
49
49
  const dryRun = core.getInput(inputs.dry_run);
50
+ core.debug(`dryRun input: ${dryRun}`);
50
51
 
51
52
  switch (dryRun) {
52
53
  case 'true':
@@ -66,6 +67,7 @@ exports.handleDryRunOption = () => {
66
67
  */
67
68
  exports.handleCiOption = () => {
68
69
  const ci = core.getInput(inputs.ci);
70
+ core.debug(`ci input: ${ci}`);
69
71
 
70
72
  switch (ci) {
71
73
  case 'true':
@@ -85,6 +87,7 @@ exports.handleCiOption = () => {
85
87
  */
86
88
  exports.handleExtends = () => {
87
89
  const extend = core.getInput(inputs.extends);
90
+ core.debug(`extend input: ${extend}`);
88
91
 
89
92
  if (extend) {
90
93
  const extendModuleNames = extend.split(/\r?\n/)
@@ -103,6 +106,7 @@ exports.handleExtends = () => {
103
106
  */
104
107
  exports.handleTagFormat = () => {
105
108
  const tagFormat = core.getInput(inputs.tag_format);
109
+ core.debug(`citagFormat input: ${tagFormat}`);
106
110
 
107
111
  if (tagFormat) {
108
112
  return {
@@ -112,3 +116,18 @@ exports.handleTagFormat = () => {
112
116
  return {};
113
117
  }
114
118
  };
119
+
120
+ /**
121
+ * Handle repository-url Option
122
+ * @returns {{}|{r: String}}
123
+ */
124
+ exports.handleRepositoryUrlOption = () => {
125
+ const repositoryUrl = core.getInput(inputs.repository_url);
126
+ core.debug(`repository_url input: ${repositoryUrl}`);
127
+
128
+ if (repositoryUrl) {
129
+ return { r: repositoryUrl };
130
+ } else {
131
+ return {};
132
+ }
133
+ };
package/src/index.js CHANGED
@@ -5,6 +5,7 @@ const {
5
5
  handleCiOption,
6
6
  handleExtends,
7
7
  handleTagFormat,
8
+ handleRepositoryUrlOption,
8
9
  } = require('./handleOptions');
9
10
  const setUpJob = require('./setUpJob.task');
10
11
  const installSpecifyingVersionSemantic = require('./installSpecifyingVersionSemantic.task');
@@ -26,13 +27,14 @@ const release = async () => {
26
27
  await preInstall(core.getInput(inputs.extra_plugins));
27
28
  await preInstall(core.getInput(inputs.extends));
28
29
 
29
- const semanticRelease = require('semantic-release');
30
- const result = await semanticRelease({
30
+ const semanticRelease = await import('semantic-release');
31
+ const result = await semanticRelease.default({
31
32
  ...handleBranchesOption(),
32
33
  ...handleDryRunOption(),
33
34
  ...handleCiOption(),
34
35
  ...handleExtends(),
35
- ...handleTagFormat()
36
+ ...handleTagFormat(),
37
+ ...handleRepositoryUrlOption()
36
38
  });
37
39
 
38
40
  await cleanupNpmrc();
package/src/inputs.json CHANGED
@@ -7,5 +7,6 @@
7
7
  "ci": "ci",
8
8
  "extends": "extends",
9
9
  "working_directory": "working_directory",
10
- "tag_format": "tag_format"
10
+ "tag_format": "tag_format",
11
+ "repository_url": "repository_url"
11
12
  }
@@ -12,7 +12,7 @@ module.exports = async (result) => {
12
12
  return Promise.resolve();
13
13
  }
14
14
 
15
- const {lastRelease, commits, nextRelease, releases} = result;
15
+ const {lastRelease, commits, nextRelease, releases} = await result;
16
16
 
17
17
  if (lastRelease.version) {
18
18
  core.debug(`The last release was "${lastRelease.version}".`);