Skip to content

Commit f6e72fb

Browse files
committed
feat: bump senamtic to v19, migrate to node v18
Closes #173 BREAKING CHANGE: Runs using nodejs v18.x and npm v8 now, so any dependencies specified in extends or additional_packages that have dependency conflicts with semantic-release v19.x will cause the action to fail.
1 parent cbd853a commit f6e72fb

7 files changed

Lines changed: 29599 additions & 10850 deletions

File tree

.github/workflows/validate.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ jobs:
77
runs-on: ubuntu-latest
88

99
steps:
10-
- uses: actions/checkout@v1
10+
- uses: actions/checkout@v2
1111

12-
- uses: actions/setup-node@v1
12+
- uses: actions/setup-node@v2
1313
with:
14-
node-version: 12.x
14+
node-version: 18.7.0
1515

1616
- run: npm ci
1717

@@ -42,7 +42,7 @@ jobs:
4242
tag_format: 'v${version}'
4343
extends: '@semantic-release/apm-config'
4444
additional_packages: |
45-
['@semantic-release/apm@3.0.0', '@semantic-release/git', '@semantic-release/apm-config']
45+
['@semantic-release/apm', '@semantic-release/git']
4646
plugins: |
4747
['@semantic-release/commit-analyzer', '@semantic-release/release-notes-generator', '@semantic-release/github', '@semantic-release/apm', '@semantic-release/git']
4848
env:

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
18.7.0

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:12.20.2
1+
FROM node:18.7.0
22

33
# nice clean home for our action files
44
RUN mkdir /action

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ inputs:
1414
required: false
1515
extends:
1616
description:
17-
'List of modules or file paths containing .
17+
'String or array of modules or file paths containing a shareable configuration.
1818
https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#extends'
1919
required: false
2020
plugins:

entrypoint.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,14 @@ const installPackages = packages => {
2222
try {
2323
const packagesArr = arrify(packages);
2424
core.debug(`Installing additional packages: ${packagesArr}`);
25-
const result = spawnSync('npm', ['install', '--no-save', ...packagesArr]);
25+
const spawn = spawnSync('npm', ['install', '--no-save', ...packagesArr], {
26+
stdio: ['inherit', 'inherit', 'pipe'],
27+
});
28+
if (spawn.status !== 0) {
29+
throw new Error(spawn.stderr);
30+
}
2631
core.debug(`Packages installed.`);
27-
return result;
32+
return spawn;
2833
} catch (err) {
2934
core.debug(`Error installing additional packages: ${packages}`);
3035
throw err;
@@ -41,7 +46,8 @@ async function run() {
4146
const branch = parseInput(core.getInput('branch', { required: false }));
4247
const branches = parseInput(core.getInput('branches', { required: false }));
4348
const plugins = parseInput(core.getInput('plugins', { required: false }));
44-
const additionalPackages = parseInput(core.getInput('additional_packages', { required: false }));
49+
const additionalPackages =
50+
parseInput(core.getInput('additional_packages', { required: false })) || [];
4551
const extendsInput = parseInput(core.getInput('extends', { required: false }));
4652
let dryRun = core.getInput('dry_run', { required: false });
4753
dryRun = dryRun !== '' ? dryRun === 'true' : '';
@@ -51,13 +57,17 @@ async function run() {
5157
core.debug(`branch input: ${branch}`);
5258
core.debug(`branches input: ${branches}`);
5359
core.debug(`plugins input: ${plugins}`);
60+
core.debug(`additional_packages input: ${additionalPackages}`);
5461
core.debug(`extends input: ${extendsInput}`);
5562
core.debug(`dry_run input: ${dryRun}`);
5663
core.debug(`repository_url input: ${repositoryUrl}`);
5764
core.debug(`tag_format input: ${tagFormat}`);
5865

59-
// install additional packages
60-
if (additionalPackages) {
66+
// install additional plugins & shareable configurations
67+
if (extendsInput) {
68+
additionalPackages.push(...arrify(extendsInput));
69+
}
70+
if (additionalPackages.length) {
6171
installPackages(additionalPackages);
6272
}
6373

0 commit comments

Comments
 (0)