# Release Ecolyo to Cozy !!! abstract "Procedure summary" - tag - build - deploy - publish ## Pre-requisites Make sure that: - you are on the right branch (dev or master) - your branch is up to date - you node modules are up to date ## Bump versions, Tag and create changelog ### manifest.webapp Checkout on the branch `dev` and bump the version number in `manifest.webapp`. Use a similar commit : _"bump manifest to X.Y.Z"_ !!! warning Commit but don't push so pipelines are not yet triggered. You don't have to change the version inside `package.json`, standard-version will do it. ### Tag with Standard-version !!! question "Standard version" [Standard-version](https://github.com/conventional-changelog/standard-version) is library that facilitates creating tags and update changelog (it uses conventional commit so make sure you follow the guidelines described [here](./gitflow.md#conventional-commit)). A release script is inside package.json, run it or use the standard-release command : ```sh yarn release 2.X.Y # Equivalent to yarn standard-version 2.X.Y ``` :warning: Do not push with VS Code The script will give you a command to push tags on the remote. (something like this, depending on the branch) ```sh git push --follow-tags origin dev ``` ??? bug "Handle mistake 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 ```sh 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 : ```sh 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. ## Create a release [Changelog.md](https://forge.grandlyon.com/web-et-numerique/factory/llle_project/ecolyo/-/blob/dev/CHANGELOG.md) will be updated with commits of the current version. To create a release, copy the content of the latest version bump and go to [Repository > Tags](https://forge.grandlyon.com/web-et-numerique/factory/llle_project/ecolyo/-/tags) and click the edit button. Paste the version changelog inside the _Release notes_ and click create. ## Deploy build After pushing your tag, the pipelines should be triggered. Verify that the **build** branch is up to date [Repository > Branches](https://forge.grandlyon.com/web-et-numerique/factory/llle_project/ecolyo/-/branches) !!! note "Manually push build" ```sh yarn build:browser yarn deploy #prod config ``` ## Publish build branch to Cozy You can deploy content of build branch into Cozy registry by using the cozy-app-publish command after replacing following value: - **$COZY_TOKEN**: token provided by Cozy team - **$VERSION_NUMBER**: version of the application - **$COZY_SPACE**: space of the Cozy :warning: Make sure that the **build branch** is up to date and was build with **prod configuration** ```sh yarn cozy-app-publish \ --token $COZY_TOKEN \ --build-url https://forge.grandlyon.com/web-et-numerique/factory/llle_project/ecolyo/-/archive/build/ecolyo-build.tar.gz \ --manual-version $VERSION_NUMBER \ --space $COZY_SPACE ``` More information at [cozy-app-publish](https://docs.cozy.io/en/cozy-app-publish/#manual-usage-not-recommended) ## Update master Once you're finish, you should create a [new merge request](https://forge.grandlyon.com/web-et-numerique/factory/llle_project/ecolyo/-/merge_requests/new#) from dev to master.