Skip to content
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

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

Open
haashem opened this issue Nov 26, 2024 · 6 comments
Open

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

haashem opened this issue Nov 26, 2024 · 6 comments

Comments

@haashem
Copy link

haashem commented Nov 26, 2024

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

@spydon
Copy link
Member

spydon commented Nov 26, 2024

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

@haashem
Copy link
Author

haashem commented Nov 27, 2024

Locally works, it's using flutter pub get

Screenshot 2024-11-27 at 09 00 38

@spydon
Copy link
Member

spydon commented Nov 27, 2024

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

@haashem
Copy link
Author

haashem commented Nov 27, 2024

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

@spydon
Copy link
Member

spydon commented Nov 27, 2024

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.

@haashem
Copy link
Author

haashem commented Nov 27, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants