Skip to content

Commit 8a4b97e

Browse files
sortiedevoncarew
andauthored
Support renaming the be channel to main. (#102)
* 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 <[email protected]>
1 parent 0970dcf commit 8a4b97e

File tree

4 files changed

+69
-90
lines changed

4 files changed

+69
-90
lines changed

CHANGELOG.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
## v1.5.1-dev
1+
## v1.5.1
22

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

79
## v1.5.0
810

dist/main.cjs

+56-85
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/sig.txt

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/main.dart

+9-3
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,15 @@ void main(List<String> args) async {
5151
version =
5252
raw ? 'latest' : (await latestPublishedVersion(channel, flavor));
5353
} else if (sdk == 'main') {
54-
channel = 'be';
55-
version =
56-
raw ? 'latest' : (await latestPublishedVersion(channel, flavor));
54+
// Check for `main` first and fall back to `be`. This handles the channel
55+
// rename from `be` to `main` (also tracked as b/299435467).
56+
try {
57+
channel = 'main';
58+
await latestPublishedVersion(channel, flavor);
59+
} catch (_) {
60+
channel = 'be';
61+
}
62+
version = 'latest';
5763
} else {
5864
version = sdk;
5965

0 commit comments

Comments
 (0)