Comment on page
Pub Release supports the concept of pre and post release hooks.
A hook is simply a script that is run before or after the release is pushed to pub.dev.
Hooks live in the following directories:
project rootis the directory where your pubspec.yaml lives.
You can include any number of scripts in each of these directories and they will be run in alphanumerical order.
When your hook is called it will be passed the new version as a cli argument:
--dry-runflag is passed to the
pub_releasecommand then a
--dry-runflag will be passed on the command line to the hook.
--dry-runflag is passed than your hook should suppress any actions that permanently modify the project.
my_hook.dart --dry-run 1.0.0