For Node modules projects we recommend installing semantic-release locally and running the semantic-release
command with npx:
npm install --save-dev semantic-release
Then in the CI environment:
npx semantic-release
Note: npx
is a tool bundled with npm@>=5.2.0
. It is used to conveniently find the semantic-release binary and to execute it. See What is npx for more details.
For other type of projects we recommend installing semantic-release directly in the CI environment, also with npx:
npx semantic-release
npx semantic-release@18
.
This way you control which major version of semantic-release is used by your build, and thus avoid breaking the build when there’s a new major version of semantic-release.{
"regexManagers": [
{
"description": "Update semantic-release version used by npx",
"fileMatch": ["^\\.github/workflows/[^/]+\\.ya?ml$"],
"matchStrings": ["\\srun: npx semantic-release@(?<currentValue>.*?)\\s"],
"datasourceTemplate": "npm",
"depNameTemplate": "semantic-release"
}
]
}
npx
is a tool bundled with npm@>=5.2.0
. You can use it to install (and run) the semantic-release binary.
See What is npx for more details.