-
Guilhem CARRON authoredGuilhem CARRON authored
Release
This section will show you how to properly create a release for the app.
Conventional commit
The Conventional Commits specification is a lightweight convention on top of commit messages. It provides an easy set of rules for creating an explicit commit history; which makes it easier to write automated tools on top of. This convention dovetails with SemVer, by describing the features, fixes, and breaking changes made in commit messages.
The commit message should be structured as follows:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
The commit contains the following structural elements, to communicate intent to the consumers of your library:
- fix: a commit of the type fix patches a bug in your codebase (this correlates with PATCH in Semantic Versioning).
- feat: a commit of the type feat introduces a new feature to the codebase (this correlates with MINOR in Semantic Versioning).
- BREAKING CHANGE: a commit that has a footer BREAKING CHANGE:, or appends a ! after the type/scope, introduces a breaking API change (correlating with MAJOR in Semantic Versioning). A BREAKING CHANGE can be part of commits of any type.
- types other than fix: and feat: are allowed, for example @commitlint/config-conventional (based on the the Angular convention) recommends build:, chore:, ci:, docs:, style:, refactor:, perf:, test:, and others.
- footers other than BREAKING CHANGE: may be provided and follow a convention similar to git trailer format.
standard-version
Standard-version is library javascript that allow to handle easily tags and changelog file.
Just run the following command in order to create a release tag, bump package.json version and update changelog file.
First manually bump the manifest version (for cozy apps) in manifest.webapp and use the following commit format : 'bump manifest version to X.X.X' Then launch the following command :
yarn run release -- --release-as X.X.X # replace with version number (ex: 1.2.0)
Once it is done execute to push the tagged commit :
git push --follow-tags origin dev
Don't forget to add release notes in gitlab in *your project -> repository -> tags -> edit release notes * You can copy paste the last changelogs in the release notes.
Anotated Tags
If you see a bug in the Changelog (the last version doesn't compare without the previous version correctly or you have plenty of undesired commits from previous versions), it means you made something wrong when you pushed your commit (basically you may have made a classical git push instead of git push --follow-tags origin dev), and you tag is not correctly annotated or annotated with the wrong commit.
You can list the annotated tag with the following command
git tag -n
A normal tag should have its related commit like this :
v2.1.3 chore(release): 2.1.3
v2.2.0 chore(release): 2.2.0
If you see some mistakes in tag annotation you can change it with the following command :
git tag -a v2.1.3 COMMIT_SHA -m 'chore(release): 2.1.3' -f
This command will annotate an existing tag (v2.1.3 with chore(release): 2.1.3 here) to the right commit. You'll have to pass the commit_sha from the related chore commit.