-
Notifications
You must be signed in to change notification settings - Fork 159
Update publishing to pub.dev #963
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
05b7015
cf77f7a
93750dd
5dfe991
0ad23ad
4f5118e
aec683a
825ea07
6c929ec
ccda324
a415838
e795adc
987b529
d326f11
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # Copyright 2025 The Flutter Authors. | ||
| # Use of this source code is governed by a BSD-style license that can be | ||
| # found in the LICENSE file. | ||
|
|
||
| # Checks changelog has been modified for changed packages. | ||
|
|
||
| # TODO(polina-c): add `dart-lang/ecosystem/.github/workflows/post_summaries.yaml@*,` | ||
| # to the org termissions, to enable this workflow | ||
|
|
||
| name: Health | ||
| on: | ||
| pull_request: | ||
| branches: [ main ] | ||
| types: [opened, synchronize, reopened, labeled, unlabeled] | ||
| jobs: | ||
| health: | ||
| uses: dart-lang/ecosystem/.github/workflows/health.yaml@main | ||
| with: | ||
| checks: "changelog" | ||
| permissions: | ||
| pull-requests: write | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,8 +19,8 @@ To make sure your PR passes this validation, follow [firehose rules](https://git | |
|
|
||
| Packages in this repo fall into the following categories: | ||
|
|
||
| 1. **Not published**: `pubspec.yaml` contains `publish_to: none`. Workspace tools and example apps that are never pushed to pub.dev. | ||
| 2. **Not yet published**: the package's `version:` ends with a `-wip<N>` suffix (see "`-wip` vs non-`-wip`" below). Published to pub.dev to reserve the name or to test the package; not ready for general use yet. | ||
| 1. **Not planned to be published**: `pubspec.yaml` contains `publish_to: none`. Workspace tools and example apps that are never pushed to pub.dev. | ||
| 2. **Not yet published**: the package's `version:` ends with a `-wip<N>` suffix (see "Versioning" below). Not-ready-for-production versions are pushed to pub.dev to reserve the name and maybe to try the package in dev purposes. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reserving the name only matters the first time that the package is published (and it could be version 0.0.0), I don't think we'll ever publish a -wip version to reserve a name (but yes for dev purposes) |
||
| 3. **Published**: any other package. Each has its own version cadence on pub.dev. | ||
|
|
||
| ## About `resolution: workspace` | ||
|
|
@@ -33,32 +33,34 @@ Packages in this repo fall into the following categories: | |
|
|
||
| Note that a package can opt out (by omitting `resolution: workspace`) to have separate dependency resolution. | ||
|
|
||
| ## `-wip` vs non-`-wip` (production ready) versions | ||
| ## Versioning | ||
|
|
||
| The packages code should be always release ready. That means: | ||
| We use [Semver] for package versioning, although before 1.0.0, we will be | ||
| incrementing only the minor number for breaking changes and the patch number for | ||
| non-breaking changes. After 1.0.0, we will be using standard Semver, bumping the | ||
| major number for breaking changes. | ||
|
|
||
| 1. Use `-wip` version (format `0.1.0-wip002`) if **at least one** of the following statements is true: | ||
| <!-- references --> | ||
|
|
||
| 1.1. The package is planned to be released in the future. In this case it is published with `-wip` suffix in order to reserve the package name. | ||
| [Semver]: https://semver.org/ | ||
|
|
||
| 1.2. The package's last changes touch only non-publishable code or docs (like tests, tools, or not-publishable docs). | ||
| The versions may have postfixes: | ||
|
|
||
| You can publish `-wip<number>` versions (where `<number>` is a three-digit, zero padded integer like `-wip003`), if you need it for development. | ||
| - **`-wip<three digit number>`**: not ready for production | ||
| - **`-noop`**: used in CHANGELOG.md and pubspec.yaml to indicate that the code does not contain publishable changes comparing to the previously published version and thus should not be published to pub.dev. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that instead of a
(We do the "Unreleased" thing in the npm packages already; keeping track of unreleased changes and making a note there if they're breaking/non-breaking in the changelog makes picking the next correct version very easy later)
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks. We will need unreleased/noop in order to be compliant with automation, that verifies version in md is intact with pub.dev and pubspec.yaml. I prefer 'noop' here, because we want 'op' changes to be released immediately after merge.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand the need for
Wouldn't it be easier for "noop" changes to not change the pubspec.yaml at all, so they're effectively non-publishable (because we can't re-publish a version that already exists?) |
||
| - **no postfix**: release ready version, that should be pushed to pub.dev right after merging the PR that introduced the changes. | ||
|
|
||
| 2. Remove `-wip` suffix from a version in `pubspec.yaml`, if your change in this package is publishable. | ||
| The packages code should be always release ready. That means: | ||
|
|
||
| 3. If your feature is partially implemented, hide the feature's code behind a false-by-default flag, and use **release-ready** version. (There is no detailed guidance how to define this flag yet. It should be outlined when it is needed. Please create an issue if you need it soon.) | ||
| 1. Use `-wip` version (format `0.1.0-wip002`) if ready versions for this packages were never published yet, and are planned to be published in the future. | ||
|
|
||
| ## Versioning | ||
| 2. Use `-noop` version if your PR touches only non-publishable code or docs (like tests, tools, or not-publishable docs). | ||
|
|
||
| We use [Semver] for package versioning, although before 1.0.0, we will be | ||
| incrementing only the minor number for breaking changes and the patch number for | ||
| non-breaking changes. After 1.0.0, we will be using standard Semver, bumping the | ||
| major number for breaking changes. | ||
| 3. You can publish `-wip<number>` versions, if you need it for development, but do not merge `wip` versions for prod-ready published packages. | ||
|
|
||
| <!-- references --> | ||
| 4. Remove `-noop` suffix from a version in `pubspec.yaml`, if your change is publishable. | ||
|
|
||
| [Semver]: https://semver.org/ | ||
| 5. If your feature is partially implemented, hide the feature's code behind a false-by-default flag, and use **release-ready** version. (There is no detailed guidance how to define this flag yet. It should be outlined when it is needed. Please create an issue if you need it soon.) | ||
|
|
||
| ## How publishing happens? | ||
|
|
||
|
|
@@ -68,7 +70,31 @@ major number for breaking changes. | |
|
|
||
| 2. **Manual**: After reviewing and merging the PR, for each 'ready to publish' version the author of the PR should run `flutter pub publish` or `dart pub publish`. | ||
|
|
||
| TODO(polinach): update this section after fix of https://github.com/dart-lang/ecosystem/issues/418. | ||
| TODO(polina-c): add validation that all PRs include CHANGELOG.md entries: https://github.com/flutter/genui/issues/967. | ||
|
|
||
| TODO(polina-c): update this section after fix of https://github.com/dart-lang/ecosystem/issues/418. | ||
|
|
||
| ## On-call responsibilities | ||
|
|
||
| Weekly: | ||
|
|
||
| 1. Make sure each releasable dart package is released (TODO: [auto-create P0 bug](https://github.com/dart-lang/ecosystem/issues/423)) | ||
| 1.1. Check the `Package publishing` table in the latest merged PR to see if all non-wip versions are marked `already published`. | ||
| 1.2. For packages not yet published, publish them by running `flutter pub publish` (if you do not have permissions, ask in the team chat to be made an admin on the admin page of the package). | ||
|
|
||
| 2. Make sure publishable changes are not under `wip` in `CHANGELOG.md` (should be [auto-validated](https://github.com/dart-lang/ecosystem/issues/422) in future). | ||
|
|
||
| If publishable changes are under `wip` in `CHANGELOG.md`: | ||
|
|
||
| 2.1. Convert the wip version to a non-wip version in `CHANGELOG.md`. | ||
|
|
||
| 2.2. Publish the new version. | ||
|
|
||
| 2.3. Comment on the PR that merged publishable changes under `wip`: | ||
|
|
||
| > This PR wrongly placed publishable changes under a `wip` version. This is corrected in PR <link>. See guidelines [here](https://github.com/flutter/genui/blob/main/docs/contributing/publishing.md#-wip-vs-non--wip-production-ready-versions). | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Needing this makes me feel that there's a point in the process that introduces ambiguity when reviewing. Do you think the "-wip" should be just a "escape hatch" when a change really really does not need to be published, that the reviewers can suggest to do? For example, in flutter/packages, there's the same expectation of "auto-publish after every push", but what this flow calls "-wip" is called "NEXT" there (see this). NEXT changes are not expected to be published at all (and the automation skips them), and only when a real release happens, their changelog entries get merged into that of the release.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting. I like the direction. For me "NEXT" also means some changes. I like 'noop' more. And, 'wip' versions still may exist as development artifact, needed for testing. I will review the doc from this perspective. |
||
|
|
||
| 2.4. Make sure the PR author and reviewers acknowledged the comment. | ||
|
|
||
| ## How upgrade of dependencies happens? | ||
|
|
||
|
|
@@ -109,8 +135,9 @@ In https://github.com/organizations/flutter/settings/actions: | |
| peter-evans/create-or-update-comment@*, | ||
| peter-evans/create-pull-request@*, | ||
| peter-evans/repository-dispatch@*, | ||
| dart-lang/ecosystem/.github/workflows/publish.yaml@*, | ||
| dart-lang/ecosystem/.github/workflows/health.yaml@*, | ||
| dart-lang/ecosystem/.github/workflows/post_summaries.yaml@*, | ||
| dart-lang/ecosystem/.github/workflows/publish.yaml@*, | ||
| ``` | ||
|
|
||
| ### Configure pub.dev for each package | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be pinned at a specific revision of the workflow, and not let it be
@main?(Also it's a little bit weird that we're depending on actions directly like this, instead of on something that has been "published", are we allowed to take this dependency from outside dart-lang? (I'm assuming yes)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am working with flutter org owners to explicitely allow these workflows.
See https://github.com/flutter/genui/blob/main/docs/contributing/publishing.md#setup-org-permissions
So, no, we do not need version
And, yes, everything is secure enough