[Web IDE] Introduce semantic release
Problem
In order to advance the automation process in Web IDE we need to introduce a semantic-release dependency and move the build scripts into its lifecycle.
Proposed solution
This issue should cover introducing the semantic-release npm package, moving deployment scripts there and switch to using semantic release versioning as the first iteration
Technical details
The first iteration would actually have quite a few things to cover apart from bringing in all the required dependencies:
- Create a
release.config.jsfile that exports the config for semantic-release - We need to define branches that it will work with. In our case it should probably be
branches: 'main', - Include
'@semantic-release/commit-analyzer'and@semantic-release/execplugins. The first one is responsible for calculating the required version, the latter - for executing a publishing script.
The release.config.js file may look something like this:
module.exports = {
branches: 'main',
plugins: [
'@semantic-release/commit-analyzer',
[
'@semantic-release/exec',
{
prepareCmd: './scripts/semantic-release-prepare.sh',
},
],
};
With this configuration, semantic-release should calculate the next version based on semantic commits that are already used in the project. The updated version should be applied to the root package.json file and could be read from it for any development scripts.
Once this issue is implemented, we will have a solid foundation for introducing other release automations with less effort.