Skip to content

Commit 293ad16

Browse files
committed
Use dart-lang/setup-dart to setup Dart SDK
Remove unneeded `dart --version` print Keeping cedx/setup-dart for `edge` SDKS until dart-lang/setup-dart#4 is fixed
1 parent af8c428 commit 293ad16

File tree

9 files changed

+66
-65
lines changed

9 files changed

+66
-65
lines changed

.github/workflows/dart.yml

Lines changed: 24 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Created with package:mono_repo v3.4.4
1+
# Created with package:mono_repo v3.4.5
22
name: Dart CI
33
on:
44
push:
@@ -29,10 +29,9 @@ jobs:
2929
os:ubuntu-latest;pub-cache-hosted;dart:dev
3030
os:ubuntu-latest;pub-cache-hosted
3131
os:ubuntu-latest
32-
- uses: cedx/setup-dart@v2
32+
- uses: dart-lang/setup-dart@v0.2
3333
with:
34-
release-channel: dev
35-
- run: dart --version
34+
sdk: dev
3635
- id: checkout
3736
uses: actions/checkout@v2
3837
- id: mono_repo_pub_upgrade
@@ -58,10 +57,9 @@ jobs:
5857
os:ubuntu-latest;pub-cache-hosted;dart:dev
5958
os:ubuntu-latest;pub-cache-hosted
6059
os:ubuntu-latest
61-
- uses: cedx/setup-dart@v2
60+
- uses: dart-lang/setup-dart@v0.2
6261
with:
63-
release-channel: dev
64-
- run: dart --version
62+
sdk: dev
6563
- id: checkout
6664
uses: actions/checkout@v2
6765
- id: mono_repo_pub_upgrade
@@ -104,11 +102,10 @@ jobs:
104102
os:ubuntu-latest;pub-cache-hosted;dart:2.7.0
105103
os:ubuntu-latest;pub-cache-hosted
106104
os:ubuntu-latest
107-
- uses: cedx/setup-dart@v2
105+
- uses: dart-lang/setup-dart@v0.2
108106
with:
109107
release-channel: stable
110108
version: "2.7.0"
111-
- run: dart --version
112109
- id: checkout
113110
uses: actions/checkout@v2
114111
- id: mono_repo_pub_upgrade
@@ -167,11 +164,10 @@ jobs:
167164
os:ubuntu-latest;pub-cache-hosted;dart:2.12.0-0.0.dev
168165
os:ubuntu-latest;pub-cache-hosted
169166
os:ubuntu-latest
170-
- uses: cedx/setup-dart@v2
167+
- uses: dart-lang/setup-dart@v0.2
171168
with:
172169
release-channel: dev
173170
version: "2.12.0-0.0.dev"
174-
- run: dart --version
175171
- id: checkout
176172
uses: actions/checkout@v2
177173
- id: test_pkg_pub_upgrade
@@ -201,10 +197,9 @@ jobs:
201197
os:ubuntu-latest;pub-cache-hosted;dart:beta
202198
os:ubuntu-latest;pub-cache-hosted
203199
os:ubuntu-latest
204-
- uses: cedx/setup-dart@v2
200+
- uses: dart-lang/setup-dart@v0.2
205201
with:
206-
release-channel: beta
207-
- run: dart --version
202+
sdk: beta
208203
- id: checkout
209204
uses: actions/checkout@v2
210205
- id: test_pkg_pub_upgrade
@@ -234,11 +229,10 @@ jobs:
234229
os:ubuntu-latest;pub-cache-hosted;dart:2.12.0-29.10.beta
235230
os:ubuntu-latest;pub-cache-hosted
236231
os:ubuntu-latest
237-
- uses: cedx/setup-dart@v2
232+
- uses: dart-lang/setup-dart@v0.2
238233
with:
239234
release-channel: beta
240235
version: "2.12.0-29.10.beta"
241-
- run: dart --version
242236
- id: checkout
243237
uses: actions/checkout@v2
244238
- id: test_pkg_pub_upgrade
@@ -268,10 +262,9 @@ jobs:
268262
os:ubuntu-latest;pub-cache-hosted;dart:stable
269263
os:ubuntu-latest;pub-cache-hosted
270264
os:ubuntu-latest
271-
- uses: cedx/setup-dart@v2
265+
- uses: dart-lang/setup-dart@v0.2
272266
with:
273-
release-channel: stable
274-
- run: dart --version
267+
sdk: stable
275268
- id: checkout
276269
uses: actions/checkout@v2
277270
- id: test_pkg_pub_upgrade
@@ -301,11 +294,10 @@ jobs:
301294
os:ubuntu-latest;pub-cache-hosted;dart:2.10.4
302295
os:ubuntu-latest;pub-cache-hosted
303296
os:ubuntu-latest
304-
- uses: cedx/setup-dart@v2
297+
- uses: dart-lang/setup-dart@v0.2
305298
with:
306299
release-channel: stable
307300
version: "2.10.4"
308-
- run: dart --version
309301
- id: checkout
310302
uses: actions/checkout@v2
311303
- id: test_pkg_pub_upgrade
@@ -335,11 +327,10 @@ jobs:
335327
os:ubuntu-latest;pub-cache-hosted;dart:2.7.0
336328
os:ubuntu-latest;pub-cache-hosted
337329
os:ubuntu-latest
338-
- uses: cedx/setup-dart@v2
330+
- uses: dart-lang/setup-dart@v0.2
339331
with:
340332
release-channel: stable
341333
version: "2.7.0"
342-
- run: dart --version
343334
- id: checkout
344335
uses: actions/checkout@v2
345336
- id: mono_repo_pub_upgrade
@@ -365,11 +356,10 @@ jobs:
365356
name: "unit_test; windows; Dart 2.7.0; PKG: mono_repo; `pub run test -x yaml -P presubmit --test-randomize-ordering-seed=random`"
366357
runs-on: windows-latest
367358
steps:
368-
- uses: cedx/setup-dart@v2
359+
- uses: dart-lang/setup-dart@v0.2
369360
with:
370361
release-channel: stable
371362
version: "2.7.0"
372-
- run: dart --version
373363
- id: checkout
374364
uses: actions/checkout@v2
375365
- id: mono_repo_pub_upgrade
@@ -405,10 +395,9 @@ jobs:
405395
os:ubuntu-latest;pub-cache-hosted;dart:dev
406396
os:ubuntu-latest;pub-cache-hosted
407397
os:ubuntu-latest
408-
- uses: cedx/setup-dart@v2
398+
- uses: dart-lang/setup-dart@v0.2
409399
with:
410-
release-channel: dev
411-
- run: dart --version
400+
sdk: dev
412401
- id: checkout
413402
uses: actions/checkout@v2
414403
- id: mono_repo_pub_upgrade
@@ -434,10 +423,9 @@ jobs:
434423
name: "unit_test; windows; Dart dev; PKG: mono_repo; `pub run test -x yaml -P presubmit --test-randomize-ordering-seed=random`"
435424
runs-on: windows-latest
436425
steps:
437-
- uses: cedx/setup-dart@v2
426+
- uses: dart-lang/setup-dart@v0.2
438427
with:
439-
release-channel: dev
440-
- run: dart --version
428+
sdk: dev
441429
- id: checkout
442430
uses: actions/checkout@v2
443431
- id: mono_repo_pub_upgrade
@@ -473,11 +461,10 @@ jobs:
473461
os:ubuntu-latest;pub-cache-hosted;dart:2.7.0
474462
os:ubuntu-latest;pub-cache-hosted
475463
os:ubuntu-latest
476-
- uses: cedx/setup-dart@v2
464+
- uses: dart-lang/setup-dart@v0.2
477465
with:
478466
release-channel: stable
479467
version: "2.7.0"
480-
- run: dart --version
481468
- id: checkout
482469
uses: actions/checkout@v2
483470
- id: mono_repo_pub_upgrade
@@ -513,10 +500,9 @@ jobs:
513500
os:ubuntu-latest;pub-cache-hosted;dart:dev
514501
os:ubuntu-latest;pub-cache-hosted
515502
os:ubuntu-latest
516-
- uses: cedx/setup-dart@v2
503+
- uses: dart-lang/setup-dart@v0.2
517504
with:
518-
release-channel: dev
519-
- run: dart --version
505+
sdk: dev
520506
- id: checkout
521507
uses: actions/checkout@v2
522508
- id: mono_repo_pub_upgrade
@@ -552,10 +538,9 @@ jobs:
552538
os:ubuntu-latest;pub-cache-hosted;dart:dev
553539
os:ubuntu-latest;pub-cache-hosted
554540
os:ubuntu-latest
555-
- uses: cedx/setup-dart@v2
541+
- uses: dart-lang/setup-dart@v0.2
556542
with:
557-
release-channel: dev
558-
- run: dart --version
543+
sdk: dev
559544
- id: checkout
560545
uses: actions/checkout@v2
561546
- id: test_pkg_pub_upgrade

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Created with package:mono_repo v3.4.4
1+
# Created with package:mono_repo v3.4.5
22
language: dart
33

44
jobs:

mono_repo/CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
## 3.4.5
2+
3+
### GitHub Actions
4+
5+
- Move to use [dart-lang/setup-dart](https://github.com/dart-lang/setup-dart)
6+
to setup the Dart SDK.
7+
- Remove explicit `dart --version` call. This is handled in the new action.
8+
- Still using [cedx/setup-dart](https://github.com/cedx/setup-dart) for
9+
the bleeding-edge SDK until
10+
[dart-lang/setup-dart#4](https://github.com/dart-lang/setup-dart/issues/4)
11+
is fixed.
12+
113
## 3.4.4
214

315
### GitHub Actions

mono_repo/lib/src/commands/github/github_yaml.dart

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,20 +334,29 @@ Map<String, dynamic> _createDartSetup(String sdk) {
334334
'release-channel': channel,
335335
'version': sdk,
336336
};
337-
} else if (const {'beta', 'dev', 'stable', 'edge'}.contains(sdk)) {
338-
withMap = {'release-channel': sdk};
337+
} else if (const {'beta', 'dev', 'stable', _edgeSdk}.contains(sdk)) {
338+
withMap = {
339+
// TODO: https://github.com/dart-lang/setup-dart/issues/4
340+
sdk == _edgeSdk ? 'release-channel' : 'sdk': sdk,
341+
};
339342
} else {
340343
unsupported();
341344
}
342345

343346
final map = {
344-
'uses': 'cedx/setup-dart@v2',
347+
'uses':
348+
// TODO: https://github.com/dart-lang/setup-dart/issues/4
349+
sdk == _edgeSdk ? 'cedx/setup-dart@v2' : 'dart-lang/setup-dart@v0.2',
345350
'with': withMap,
346351
};
347352

348353
return map;
349354
}
350355

356+
// TODO: Need to special-case `edge` SDKS until
357+
// https://github.com/dart-lang/setup-dart/issues/4 is fixed.
358+
const _edgeSdk = 'edge';
359+
351360
/// Returns the content of a Github Action Job.
352361
///
353362
/// See https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobs
@@ -385,7 +394,8 @@ Map<String, dynamic> _githubJobYaml(
385394
},
386395
),
387396
_createDartSetup(dartVersion),
388-
{'run': 'dart --version'},
397+
// TODO: https://github.com/dart-lang/setup-dart/issues/4
398+
if (dartVersion == _edgeSdk) {'run': 'dart --version'},
389399
{
390400
'id': 'checkout',
391401
'uses': 'actions/checkout@v2',

mono_repo/lib/src/version.dart

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mono_repo/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: mono_repo
22
description: >-
33
CLI tools to make it easier to manage a single source repository containing
44
multiple Dart packages.
5-
version: 3.4.4
5+
version: 3.4.5
66
repository: https://github.com/google/mono_repo.dart
77

88
environment:

mono_repo/test/script_integration_outputs/readme_github_defaults.txt

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,9 @@ jobs:
3030
os:ubuntu-latest;pub-cache-hosted;dart:dev
3131
os:ubuntu-latest;pub-cache-hosted
3232
os:ubuntu-latest
33-
- uses: cedx/setup-dart@v2
33+
- uses: dart-lang/setup-dart@v0.2
3434
with:
35-
release-channel: dev
36-
- run: dart --version
35+
sdk: dev
3736
- id: checkout
3837
uses: actions/checkout@v2
3938
- id: sub_pkg_pub_upgrade
@@ -59,10 +58,9 @@ jobs:
5958
os:ubuntu-latest;pub-cache-hosted;dart:dev
6059
os:ubuntu-latest;pub-cache-hosted
6160
os:ubuntu-latest
62-
- uses: cedx/setup-dart@v2
61+
- uses: dart-lang/setup-dart@v0.2
6362
with:
64-
release-channel: dev
65-
- run: dart --version
63+
sdk: dev
6664
- id: checkout
6765
uses: actions/checkout@v2
6866
- id: sub_pkg_pub_upgrade
@@ -81,10 +79,9 @@ jobs:
8179
name: "cron; windows; `pub run test`"
8280
runs-on: windows-latest
8381
steps:
84-
- uses: cedx/setup-dart@v2
82+
- uses: dart-lang/setup-dart@v0.2
8583
with:
86-
release-channel: dev
87-
- run: dart --version
84+
sdk: dev
8885
- id: checkout
8986
uses: actions/checkout@v2
9087
- id: sub_pkg_pub_upgrade

mono_repo/test/script_integration_outputs/readme_github_lints.txt

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,9 @@ jobs:
2828
restore-keys: |
2929
os:ubuntu-latest;pub-cache-hosted
3030
os:ubuntu-latest
31-
- uses: cedx/setup-dart@v2
31+
- uses: dart-lang/setup-dart@v0.2
3232
with:
33-
release-channel: stable
34-
- run: dart --version
33+
sdk: stable
3534
- id: checkout
3635
uses: actions/checkout@v2
3736
- name: mono_repo self validate
@@ -52,10 +51,9 @@ jobs:
5251
os:ubuntu-latest;pub-cache-hosted;dart:dev
5352
os:ubuntu-latest;pub-cache-hosted
5453
os:ubuntu-latest
55-
- uses: cedx/setup-dart@v2
54+
- uses: dart-lang/setup-dart@v0.2
5655
with:
57-
release-channel: dev
58-
- run: dart --version
56+
sdk: dev
5957
- id: checkout
6058
uses: actions/checkout@v2
6159
- id: sub_pkg_pub_upgrade
@@ -81,10 +79,9 @@ jobs:
8179
os:ubuntu-latest;pub-cache-hosted;dart:dev
8280
os:ubuntu-latest;pub-cache-hosted
8381
os:ubuntu-latest
84-
- uses: cedx/setup-dart@v2
82+
- uses: dart-lang/setup-dart@v0.2
8583
with:
86-
release-channel: dev
87-
- run: dart --version
84+
sdk: dev
8885
- id: checkout
8986
uses: actions/checkout@v2
9087
- id: sub_pkg_pub_upgrade

tool/ci.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Created with package:mono_repo v3.4.4
2+
# Created with package:mono_repo v3.4.5
33

44
# Support built in commands on windows out of the box.
55
function pub() {

0 commit comments

Comments
 (0)