build: use release-it to generate release data #817
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Current way of generating release info at build time to be included in the app has several issues:
main
branch. However, it may also happen on PRs. Like when pushing two commits within a very short interval of time. For same reason. Or if a PR is opened whose base is not the latest commit onmain
. It's a nice check when performing the release, but should be nice to be able to disable it when just generating release data (version to release / changelog) at build time.In order to solve limitations of Semantic Release,
release-it
is introduced for the same task. Though for now, only generates a JSON file with release information that is embedded into the app. It's quite fast compared to Semantic Release, 1-2s for the dry-run release process.Also, it allows (with some options and a bit of hacky tricks) to generate the
CHANGELOG.md
for the latest release. So the process can be simplified to:It's not perfect, though:
style
orrefactor
ordocs
ones. But a release is always generated by default. So needs custom logic to know which next version to bump (which is actually the main purpose of the conventional changelog plugin). But that's an issue in the upstream Conventional Changelog tooling repository. Where a patch version is always released if no features or breaking changes are found.Script to generate release file is reduced from 280+ lines to barely 100! Yay 🎉
Tested it can also generate release info when a tag exists for current commit