Skip to main content

Release Guidelines

If you are a developer on the MobX project, here are few guidelines that will help in your journey. These apply to all the packages: mobx, mobx_codegen, flutter_mobx.

1. Format your code​

To format your files following Dart guidelines. This will format your code accordingly regardless of your IDE settings.

dartfmt -w .

2. pubspec.yaml​

  • Use the semantic versioning policy to update the version in pubspec.yaml.
  • Say you are updating from 0.1.0 to 0.2.0, then update the version field in pubspec.yaml:
version: 0.2.0

3. Expose version​

  • Expose the updated version of pubspec.yaml to the library by running the following command in each package. This will run this command in each of the package folders.
melos run set_version
note

This requires you to have the melos package installed globally. Install it using:

dart pub global activate melos

4. Changelog​

  • Update the CHANGELOG.md file to include the changes introduced in the new version. Normally, you would do this by adding a new bullet point for the version and follow the template from earlier versions.
  • If the changes are minimal, you can also append the change to an earlier bullet point but include the new version as a range. For example, the changes in 0.3.2+3 were minimal, so we added it as a range from the earlier version.
## 0.3.0 - 0.3.2+3

5. Git Push​

And that's it! The rest of the work will be automatically done by Github Actions. The Build and Publish workflow will inspect the local and remote versions of the package and publish to pub.dev if newer. It will also tag the commit with the right tags following the format of: <package-name>-<version-number>