melos-action icon indicating copy to clipboard operation
melos-action copied to clipboard

ci: flutter users should use 'flutter pub' instead of 'dart pub'.

Open haashem opened this issue 1 year ago • 6 comments

Hi,

On CI, I have switched to Flutter main channel, but melos action fails when starts to do bootstrap, does it mean the action needs to be updated?

 steps:
      - name: ⬇️ Checkout repository
        uses: actions/checkout@v3
      - name: ⚙️ Setup Flutter
        uses: subosito/flutter-action@v2
        with:
          channel: main
      - name: ⚙️ Setup Melos
        uses: bluefireteam/melos-action@v3

Screenshot 2024-11-26 at 11 54 54

haashem avatar Nov 26 '24 13:11 haashem

So it works on Flutter stable, but not on main? Does it work when running bootstrap locally with Flutter from main?

spydon avatar Nov 26 '24 13:11 spydon

Locally works, it's using flutter pub get

Screenshot 2024-11-27 at 09 00 38

haashem avatar Nov 27 '24 09:11 haashem

Can you post the local output of flutter --version and melos --version?

spydon avatar Nov 27 '24 09:11 spydon

melos 6.2.0
Flutter 3.27.0-1.0.pre.628 • channel main • [email protected]:flutter/flutter.git
Framework • revision a0c3060c68 (2 days ago) • 2024-11-24 21:34:37 -0500
Engine • revision ce1eb371ea
Tools • Dart 3.7.0 (build 3.7.0-183.0.dev) • DevTools 2.41.0-dev.2

haashem avatar Nov 27 '24 13:11 haashem

Are you sure you have specified Flutter in the dependency list? It should be checking whether it is a Flutter package/app when running pub get here (by checking if Flutter is in the dependency list, so not just a transitive dependency): https://github.com/invertase/melos/blame/main/packages/melos/lib/src/commands/bootstrap.dart#L222

It's odd that it behaves differently locally and in the CI for you.

spydon avatar Nov 27 '24 14:11 spydon

Locally when I call melos bs, it runs flutter pub get command as shown in above screenshot. I have only one package which is just pure dart and has no reference to flutter. (http_interface).

Running "flutter pub get" in workspace packages...

pubspec.yaml on root directory, used by melos:

name: store
description: It's only used by melos

environment:
  sdk: ">=3.0.0 <4.0.0"
  flutter: ">=3.7.0 <4.0.0"

dev_dependencies:
  melos: ^6.2.0
  lint: ^2.3.0

haashem avatar Nov 27 '24 17:11 haashem