Skip to content

Commit

Permalink
feat: bump senamtic to v19, migrate to node v18
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
codfish committed Aug 9, 2022
1 parent cbd853a commit f6e72fb
Show file tree
Hide file tree
Showing 7 changed files with 29,599 additions and 10,850 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2

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

- run: npm ci

Expand Down Expand Up @@ -42,7 +42,7 @@ jobs:
tag_format: 'v${version}'
extends: '@semantic-release/apm-config'
additional_packages: |
['@semantic-release/apm@3.0.0', '@semantic-release/git', '@semantic-release/apm-config']
['@semantic-release/apm', '@semantic-release/git']
plugins: |
['@semantic-release/commit-analyzer', '@semantic-release/release-notes-generator', '@semantic-release/github', '@semantic-release/apm', '@semantic-release/git']
env:
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.7.0
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:12.20.2
FROM node:18.7.0

# nice clean home for our action files
RUN mkdir /action
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ inputs:
required: false
extends:
description:
'List of modules or file paths containing .
'String or array of modules or file paths containing a shareable configuration.
https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#extends'
required: false
plugins:
Expand Down
20 changes: 15 additions & 5 deletions entrypoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,14 @@ const installPackages = packages => {
try {
const packagesArr = arrify(packages);
core.debug(`Installing additional packages: ${packagesArr}`);
const result = spawnSync('npm', ['install', '--no-save', ...packagesArr]);
const spawn = spawnSync('npm', ['install', '--no-save', ...packagesArr], {
stdio: ['inherit', 'inherit', 'pipe'],
});
if (spawn.status !== 0) {
throw new Error(spawn.stderr);
}
core.debug(`Packages installed.`);
return result;
return spawn;
} catch (err) {
core.debug(`Error installing additional packages: ${packages}`);
throw err;
Expand All @@ -41,7 +46,8 @@ async function run() {
const branch = parseInput(core.getInput('branch', { required: false }));
const branches = parseInput(core.getInput('branches', { required: false }));
const plugins = parseInput(core.getInput('plugins', { required: false }));
const additionalPackages = parseInput(core.getInput('additional_packages', { required: false }));
const additionalPackages =
parseInput(core.getInput('additional_packages', { required: false })) || [];
const extendsInput = parseInput(core.getInput('extends', { required: false }));
let dryRun = core.getInput('dry_run', { required: false });
dryRun = dryRun !== '' ? dryRun === 'true' : '';
Expand All @@ -51,13 +57,17 @@ async function run() {
core.debug(`branch input: ${branch}`);
core.debug(`branches input: ${branches}`);
core.debug(`plugins input: ${plugins}`);
core.debug(`additional_packages input: ${additionalPackages}`);
core.debug(`extends input: ${extendsInput}`);
core.debug(`dry_run input: ${dryRun}`);
core.debug(`repository_url input: ${repositoryUrl}`);
core.debug(`tag_format input: ${tagFormat}`);

// install additional packages
if (additionalPackages) {
// install additional plugins & shareable configurations
if (extendsInput) {
additionalPackages.push(...arrify(extendsInput));
}
if (additionalPackages.length) {
installPackages(additionalPackages);
}

Expand Down
Loading

0 comments on commit f6e72fb

Please sign in to comment.