Skip to content

Commit 97fbfd6

Browse files
committed
fix(release): always update package.json version
When not releasing to NPM in a standard repo (as opposed to a monorepo), no logic to update the package.json version field was triggered. This change runs the semantic-release/npm[1] plugin with "npmPublish" disabled. This updates the package.json version field without publishing to NPM. In normal operation we do want to trigger the release, so if the publisher is set to 'npm' it works according to the default. [1] https://github.com/semantic-release/npm#options
1 parent 20ab14f commit 97fbfd6

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

packages/utils/src/cmds/release.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,15 @@ function publisher(target = '', packages) {
2727
}
2828

2929
default: {
30-
return [undefined]
30+
return packages.filter(packageIsPublishable).map(pkgJsonPath => {
31+
return [
32+
'@semantic-release/npm',
33+
{
34+
pkgRoot: path.dirname(pkgJsonPath),
35+
npmPublish: false,
36+
},
37+
]
38+
})
3139
}
3240
}
3341
}

0 commit comments

Comments
 (0)