@@ -147,3 +147,74 @@ Newly opened PRs first go through initial triage which results in one of:
147
147
* ** Starting a non trivial review** - if the review requires non trivial effort and the issue is a priority; in this case the maintainer will:
148
148
* Add the "in review" label to the issue.
149
149
* Self assign the PR.
150
+
151
+ ### The release process
152
+
153
+ We push releases manually. Generally every merged PR upgrades at least one
154
+ plugin's ` pubspec.yaml ` , so also needs to be published as a package release. The
155
+ Flutter team member most involved with the PR should be the person responsible
156
+ for publishing the package release. In cases where the PR is authored by a
157
+ Flutter maintainer, the publisher should probably be the author. In other cases
158
+ where the PR is from a contributor, it's up to the reviewing Flutter team member
159
+ to publish the release instead.
160
+
161
+ Some things to keep in mind before publishing the release:
162
+
163
+ - Has CI ran on the master commit and gone green? Even if CI shows as green on
164
+ the PR it's still possible for it to fail on merge, for multiple reasons.
165
+ There may have been some bug in the merge that introduced new failures. CI
166
+ runs on PRs as it's configured on their branch state, and not on tip of tree.
167
+ CI on PRs also only runs tests for packages that it detects have been directly
168
+ changed, vs running on every single package on master.
169
+ - [ Publishing is
170
+ forever.] ( https://dart.dev/tools/pub/publishing#publishing-is-forever )
171
+ Hopefully any bugs or breaking in changes in this PR have already been caught
172
+ in PR review, but now's a second chance to revert before anything goes live.
173
+ - "Don't deploy on a Friday." Consider carefully whether or not it's worth
174
+ immediately publishing an update before a stretch of time where you're going
175
+ to be unavailable. There may be bugs with the release or questions about it
176
+ from people that immediately adopt it, and uncovering and resolving those
177
+ support issues will take more time if you're unavailable.
178
+
179
+ Releasing a package is a two-step process.
180
+
181
+ 1 . Push the package update to [ pub.dev] ( https://pub.dev ) using ` pub publish ` .
182
+ 2 . Tag the commit with git in the format of ` <package_name>-v<package_version> ` ,
183
+ and then push the tag to the ` flutter/plugins ` master branch. This can be
184
+ done manually with ` git tag $tagname && git push upstream $tagname ` while
185
+ checked out on the commit that updated ` version ` in ` pubspec.yaml ` .
186
+
187
+ We've recently updated
188
+ [ flutter_plugin_tools] ( https://github.com/flutter/plugin_tools ) to wrap both of
189
+ those steps into one command to make it a little easier. This new tool is
190
+ experimental. Feel free to fall back on manually running ` pub publish ` and
191
+ creating and pushing the tag in git if there are issues with it.
192
+
193
+ Install the tool by running:
194
+
195
+ ``` terminal
196
+ $ pub global activate flutter_plugin_tools
197
+ ```
198
+
199
+ Then, from the root of your local ` flutter/plugins ` repo, use the tool to
200
+ publish a release.
201
+
202
+ ``` terminal
203
+ $ pub global run flutter_plugin_tools publish-plugin --package $package
204
+ ```
205
+
206
+ By default the tool tries to push tags to the ` upstream ` remote, but that and
207
+ some additional settings can be configured. Run `pub global activate
208
+ flutter_plugin_tools --help` for more usage information.
209
+
210
+ The tool wraps ` pub publish ` for pushing the package to pub, and then will
211
+ automatically use git to try and create and push tags. It has some additional
212
+ safety checking around ` pub publish ` too. By default ` pub publish ` publishes
213
+ _ everything_ , including untracked or uncommitted files in version control.
214
+ ` flutter_plugin_tools publish-plugin ` will first check the status of the local
215
+ directory and refuse to publish if there are any mismatched files with version
216
+ control present.
217
+
218
+ There is a lot about this process that is still to be desired. Some top level
219
+ items are being tracked in
220
+ [ flutter/flutter #27258 ] ( https://github.com/flutter/flutter/issues/27258 ) .
0 commit comments