|
| 1 | +## Contributions, PRs, and publishing |
| 2 | + |
| 3 | +When contributing to packages that use our publishing validation and automation bot: |
| 4 | + |
| 5 | +- if the package version is a stable semver version (`x.y.z`), the latest |
| 6 | + changes have been published to pub. Please add a new changelog section for |
| 7 | + your change, rev the service portion of the version, append `-dev`, and update |
| 8 | + the pubspec version to agree with the new version |
| 9 | +- if the package version ends in `-dev`, the latest changes are unpublished; |
| 10 | + please add a new changelog entry for your change in the most recent section. |
| 11 | + When we decide to publish the latest changes we'll drop the `-dev` suffix |
| 12 | + from the package version |
| 13 | +- for PRs, the `Publish` bot will perform basic validation of the info in the |
| 14 | + pubspec.yaml and CHANGELOG.md files |
| 15 | +- when the PR is merged into the main branch, if the change includes reving to |
| 16 | + a new stable version, a repo maintainer will tag that commit with the pubspec |
| 17 | + version (e.g., `v1.2.3`); that tag event will trigger the `Publish` bot to |
| 18 | + publish a new version of the package to pub.dev |
| 19 | + |
| 20 | +If the `dart pub publish --dry-run` step is failing during PR validation, and |
| 21 | +it's for a reason that could legitimately be ignored (publishing using a |
| 22 | +pre-release SDK?), repo committers can add the `publish-ignore-warnings` label |
| 23 | +to the PR in order to ignore failures from a publishing dry-run. |
| 24 | + |
| 25 | +## More publishing conventions |
| 26 | + |
| 27 | +For more information on dart-lang package publishing and maintenance conventions, |
| 28 | +see https://github.com/dart-lang/sdk/wiki/External-Package-Maintenance. |
| 29 | + |
| 30 | +## For committers: publishing a release |
| 31 | + |
| 32 | +> TLDR: After merging a PR, create a new GitHub release to publish it. This is best done |
| 33 | +using the link that firehose creates in the 'Package publishing' comment. |
| 34 | + |
| 35 | +Once a new release is ready to go - the latest bits have landed in the default branch - |
| 36 | +it can be published by tagging the commit with a well-formed tag. Generally this is in |
| 37 | +the form of `package_name-v1.2.3`; the publishing automation will indicate the correct |
| 38 | +tag to use in the PR. |
| 39 | + |
| 40 | +There are two ways to do this. One is by tagging the commit via the command line and |
| 41 | +pushing the new tag to the repo. That's correct, but there's a better way. |
| 42 | + |
| 43 | +The 2nd way to publish is by creating a github release (see the `/releases` url of your |
| 44 | +repo; e.g., https://github.com/dart-lang/tools/releases). Creating a new release there |
| 45 | +will tag the commit as a by-product, which will trigger a release. To create a release: |
| 46 | + |
| 47 | +- go to the `https://github.com/<org>/<repo>/releases` url |
| 48 | +- click 'draft a new release' |
| 49 | +- in 'choose tag', enter the tag of the correct publishing tag (you'll be creating a new tag) |
| 50 | +- in 'release title', enter the same text as the tag (by convention; this area is free-form) |
| 51 | +- in 'describe this release', enter the portion of the changelog entry for this release |
| 52 | + |
| 53 | +Firehose will create a hyperlink in it's comment on the PR with all the release information |
| 54 | +filled out. After the PR is merged - and we're ready to publish - it is highly recommended to |
| 55 | +use this link to create the release (instead of manually filling in the information). This |
| 56 | +helps make our releases more standardized and less error-prone. |
0 commit comments