5
0
Fork 0
mirror of https://github.com/cycjimmy/semantic-release-action.git synced 2025-11-07 10:46:56 +00:00

Merge pull request #171 from enell/node20

feat: update node version to 20
This commit is contained in:
Geoffrey.C 2023-08-31 10:53:01 +08:00 committed by GitHub
commit 31a37a4689
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 4667 additions and 2603 deletions

View file

@ -48,7 +48,7 @@ jobs:
- name: Setup Node.js with GitHub Package Registry
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20
registry-url: 'https://npm.pkg.github.com'
scope: 'cycjimmy'

View file

@ -20,7 +20,7 @@ steps:
- name: Checkout
uses: actions/checkout@v3
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v3
uses: cycjimmy/semantic-release-action@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
@ -63,7 +63,7 @@ steps:
- name: Checkout
uses: actions/checkout@v3
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v3
uses: cycjimmy/semantic-release-action@v4
with:
semantic_version: 19.0.5 # It is recommended to specify a version range
# for semantic-release when using
@ -73,9 +73,7 @@ steps:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
```
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.
*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).*
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.
#### branches
> {Optional Input Parameter} The branches on which releases should happen.<br>`branches` supports for **semantic-release above v16**.
@ -85,7 +83,7 @@ steps:
- name: Checkout
uses: actions/checkout@v3
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v3
uses: cycjimmy/semantic-release-action@v4
with:
semantic_version: 16
# you can set branches for semantic-release above v16.
@ -131,7 +129,7 @@ steps:
- name: Checkout
uses: actions/checkout@v3
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v3
uses: cycjimmy/semantic-release-action@v4
with:
semantic_version: 15.13.28
# you can set branch for semantic-release older than v16.
@ -156,7 +154,7 @@ steps:
- name: Checkout
uses: actions/checkout@v3
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v3
uses: cycjimmy/semantic-release-action@v4
with:
# You can specify specifying version range for the extra plugins if you prefer.
extra_plugins: |
@ -186,7 +184,7 @@ steps:
- name: Checkout
uses: actions/checkout@v3
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v3
uses: cycjimmy/semantic-release-action@v4
with:
dry_run: true
env:
@ -202,7 +200,7 @@ steps:
- name: Checkout
uses: actions/checkout@v3
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v3
uses: cycjimmy/semantic-release-action@v4
with:
ci: false
env:
@ -220,7 +218,7 @@ steps:
- name: Checkout
uses: actions/checkout@v3
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v3
uses: cycjimmy/semantic-release-action@v4
with:
# You can extend an existing shareable configuration.
# And you can specify version range for the shareable configuration if you prefer.
@ -240,7 +238,7 @@ steps:
- name: Checkout
uses: actions/checkout@v3
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v3
uses: cycjimmy/semantic-release-action@v4
with:
# You can select another working directory like a subdirectory for example.
working_directory: ./code
@ -257,7 +255,7 @@ steps:
- name: Checkout
uses: actions/checkout@v3
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v3
uses: cycjimmy/semantic-release-action@v4
with:
tag_format: custom-v${version}
env:
@ -287,7 +285,7 @@ steps:
- name: Checkout
uses: actions/checkout@v3
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v3
uses: cycjimmy/semantic-release-action@v4
id: semantic # Need an `id` for output variables
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View file

@ -58,5 +58,5 @@ outputs:
last_release_git_tag:
description: 'The Git tag associated with the last release, if there was one.'
runs:
using: 'node16'
using: 'node20'
main: 'index.js'

7310
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -22,9 +22,9 @@
"homepage": "https://github.com/cycjimmy/semantic-release-action#readme",
"dependencies": {
"@actions/core": "^1.10.0",
"@cycjimmy/awesome-js-funcs": "^4.0.4",
"@cycjimmy/awesome-js-funcs": "^4.0.9",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"semantic-release": "^19.0.5"
"semantic-release": "^21.1.1"
}
}

View file

@ -47,6 +47,7 @@ exports.handleBranchesOption = () => {
*/
exports.handleDryRunOption = () => {
const dryRun = core.getInput(inputs.dry_run);
core.debug(`dryRun input: ${dryRun}`);
switch (dryRun) {
case 'true':
@ -66,6 +67,7 @@ exports.handleDryRunOption = () => {
*/
exports.handleCiOption = () => {
const ci = core.getInput(inputs.ci);
core.debug(`ci input: ${ci}`);
switch (ci) {
case 'true':
@ -85,6 +87,7 @@ exports.handleCiOption = () => {
*/
exports.handleExtends = () => {
const extend = core.getInput(inputs.extends);
core.debug(`extend input: ${extend}`);
if (extend) {
const extendModuleNames = extend.split(/\r?\n/)
@ -103,6 +106,7 @@ exports.handleExtends = () => {
*/
exports.handleTagFormat = () => {
const tagFormat = core.getInput(inputs.tag_format);
core.debug(`citagFormat input: ${tagFormat}`);
if (tagFormat) {
return {

View file

@ -26,8 +26,8 @@ const release = async () => {
await preInstall(core.getInput(inputs.extra_plugins));
await preInstall(core.getInput(inputs.extends));
const semanticRelease = require('semantic-release');
const result = await semanticRelease({
const semanticRelease = await import('semantic-release');
const result = await semanticRelease.default({
...handleBranchesOption(),
...handleDryRunOption(),
...handleCiOption(),

View file

@ -12,7 +12,7 @@ module.exports = async (result) => {
return Promise.resolve();
}
const {lastRelease, commits, nextRelease, releases} = result;
const {lastRelease, commits, nextRelease, releases} = await result;
if (lastRelease.version) {
core.debug(`The last release was "${lastRelease.version}".`);