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

Install a Flutter SDK in the publish workflow #141

Merged
merged 2 commits into from
Nov 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,16 @@ jobs:
steps:
# Checkout repository
- uses: actions/checkout@v4
# Setup Dart SDK with JWT token
# Set up the Dart SDK and provision the OIDC token used for publishing.
# The `dart` command from this step will be shadowed by the one from the
# Flutter SDK below.
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
# Download flutter SDK - needed for publishing Flutter packages. Can also
# publish pure Dart packages.
#
# The dart binary from a Flutter SDK facilitates publishing both Flutter
# and pure-dart packages.
- uses: flutter-actions/setup-flutter@d030cb603380106494f72d65a7e52462f380781f
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dart binary from here will shadow the one installed from the previous step (dart-lang/setup-dart).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I don't know if this is an improvement - I haven't thought through the use cases - but we could parameterize this workflow (workflow_call > inputs, above) to indicate which sdk should be set up here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any downside to using the Dart SDK from Flutter to publish?

It's a Dart SDK like the other one, the only difference is that it can resolve flutter dependencies.

It's not exactly a pretty solution, but we can always add more inputs in the future. And if we can do more without asking people to make a special case that would be nice :D

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't think of any downsides (just that the optics are a little strange esp. given that this workflow is hosted in the dart-lang/setup-dart repo).

No concerns w/ this however. I would remove the line above - uses: dart-lang/setup-dart as that'll become a no-op given the uses: flutter-actions/setup-flutter line.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The setup-dart step is still important because it configures the OIDC token.

Gotcha. Perhaps update the comments in this file? 'Set up the Dart SDK and provision the OIDC token used for publishing'; 'Set up the Flutter SDK; use the dart command from here to facilitate publishing both dart and flutter packages'.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

# Minimal package setup and dry run checks.
- name: Install dependencies
run: dart pub get
Expand Down