Skip to content

Commit

Permalink
Support renaming the be channel to main. (#102)
Browse files Browse the repository at this point in the history
* Support renaming the be channel to main.

This change automatically detects when the main channel pops into
existence and starts using the latest version of it instead. The forward
compatibility will be removed once the channel has been renamed.

Bug: b/270022609

* recompile action

* Add changelog entry for the be -> main rename.

* update todo and rev changelog version

---------

Co-authored-by: Devon Carew <devoncarew@google.com>
  • Loading branch information
sortie and devoncarew committed Sep 13, 2023
1 parent 0970dcf commit 8a4b97e
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 90 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
@@ -1,8 +1,10 @@
## v1.5.1-dev
## v1.5.1

* No longer test the `setup-dart` action on pre-2.12 SDKs.
* Upgrade JS interop code to use extension types
(the new name for inline classes).
* The upcoming rename of the `be` channel to `main` is now supported with
forward compatibility that switches when the rename happens.

## v1.5.0

Expand Down
141 changes: 56 additions & 85 deletions dist/main.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/sig.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions lib/main.dart
Expand Up @@ -51,9 +51,15 @@ void main(List<String> args) async {
version =
raw ? 'latest' : (await latestPublishedVersion(channel, flavor));
} else if (sdk == 'main') {
channel = 'be';
version =
raw ? 'latest' : (await latestPublishedVersion(channel, flavor));
// Check for `main` first and fall back to `be`. This handles the channel
// rename from `be` to `main` (also tracked as b/299435467).
try {
channel = 'main';
await latestPublishedVersion(channel, flavor);
} catch (_) {
channel = 'be';
}
version = 'latest';
} else {
version = sdk;

Expand Down

0 comments on commit 8a4b97e

Please sign in to comment.