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

Use Flutter version in CI from top level env in file. #140

Merged
merged 2 commits into from
Apr 8, 2022

Conversation

nilsreichardt
Copy link
Member

No description provided.

@github-actions
Copy link

github-actions bot commented Apr 8, 2022

Visit the preview URL for this PR (updated for commit 65270b8):

https://sharezone-test--pr140-use-flutter-version-6ykybiez.web.app

(expires Fri, 15 Apr 2022 17:33:41 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Copy link
Collaborator

@Jonas-Sander Jonas-Sander left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Do you know if there is some way to define the flutter version in another file (maybe top level) and use it inside GitHub Actions?
In this way we could maybe one day use e.g. fvm and GitHub Actions and always be sure to use the same version (version file would be the single source of truth)

@nilsreichardt
Copy link
Member Author

Yes, it's possible. We could normally use fvm and then install Flutter not with an GitHub Action (subosito/flutter-action@v1). So the workflow would be:

  1. Install Dart
  2. Install fvm
  3. Install Flutter via fvm.

Therefore, we would have a SOT for our Flutter version.

The downside is that this would probably extend the CI duration by 1 min (probably more) for just installing Dart, fvm, etc.

@nilsreichardt nilsreichardt enabled auto-merge (squash) April 8, 2022 17:29
@nilsreichardt nilsreichardt merged commit f84ff9d into main Apr 8, 2022
@nilsreichardt nilsreichardt deleted the use-flutter-version-from-env branch April 8, 2022 17:36
@Jonas-Sander
Copy link
Collaborator

Yes, it's possible. We could normally use fvm and then install Flutter not with an GitHub Action (subosito/flutter-action@v1). So the workflow would be:

  1. Install Dart
  2. Install fvm
  3. Install Flutter via fvm.

Therefore, we would have a SOT for our Flutter version.

The downside is that this would probably extend the CI duration by 1 min (probably more) for just installing Dart, fvm, etc.

Can't we just read in a file with the version and use the normal flutter-action with the specified version?

@nilsreichardt
Copy link
Member Author

Can't we just read in a file with the version and use the normal flutter-action with the specified version?

I think this is not possible with GitHub Actions

@Jonas-Sander
Copy link
Collaborator

Can't we just read in a file with the version and use the normal flutter-action with the specified version?

I think this is not possible with GitHub Actions

https://stackoverflow.com/questions/61919141/read-json-file-in-github-actions

Wouldn't this enable our use-case?

@nilsreichardt
Copy link
Member Author

Ah, of course it's possible. I was thinking to set Flutter version at top level env, where we can't run shell commands. But in the job, we can easily read out a file and export the Flutter version as environment variable 👍

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

Successfully merging this pull request may close these issues.

2 participants