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

feat: update node version on runner to 20

BREAKING CHANGE: set the default node version to 20
This commit is contained in:
Johan Enell 2023-08-15 15:31:16 +00:00
parent 7f0c0e4904
commit 0c2055456e
8 changed files with 4653 additions and 2589 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

@ -75,8 +75,6 @@ steps:
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).*
#### branches
> {Optional Input Parameter} The branches on which releases should happen.<br>`branches` supports for **semantic-release above v16**.

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'

7224
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -25,6 +25,6 @@
"@cycjimmy/awesome-js-funcs": "^4.0.4",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"semantic-release": "^19.0.5"
"semantic-release": "^21.0.9"
}
}

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}".`);