Skip to content

Commit

Permalink
feat: update node version on runner to 20
Browse files Browse the repository at this point in the history
BREAKING CHANGE: set the default node version to 20
  • Loading branch information
enell committed Aug 24, 2023
1 parent 7f0c0e4 commit 0c20554
Show file tree
Hide file tree
Showing 8 changed files with 4,514 additions and 2,450 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**.

Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
6,946 changes: 4,504 additions & 2,442 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
4 changes: 4 additions & 0 deletions src/handleOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ exports.handleBranchesOption = () => {
*/
exports.handleDryRunOption = () => {
const dryRun = core.getInput(inputs.dry_run);
core.debug(`dryRun input: ${dryRun}`);

switch (dryRun) {
case 'true':
Expand All @@ -66,6 +67,7 @@ exports.handleDryRunOption = () => {
*/
exports.handleCiOption = () => {
const ci = core.getInput(inputs.ci);
core.debug(`ci input: ${ci}`);

switch (ci) {
case 'true':
Expand All @@ -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/)
Expand All @@ -103,6 +106,7 @@ exports.handleExtends = () => {
*/
exports.handleTagFormat = () => {
const tagFormat = core.getInput(inputs.tag_format);
core.debug(`citagFormat input: ${tagFormat}`);

if (tagFormat) {
return {
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
2 changes: 1 addition & 1 deletion src/windUpJob.task.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}".`);
Expand Down

0 comments on commit 0c20554

Please sign in to comment.