-
Notifications
You must be signed in to change notification settings - Fork 38
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
Generalize publishing GitHub Action to support flutter #68
Comments
@devoncarew is |
I had the same/similar problem after updating to Flutter 3.7. Something has changed and while previously |
@sigurdm, I think the fact that we patched On topic, I think it would be great if the reusable-workflow could be used to publish flutter packages with: I really would love to recommend that people use the reusable workflow as it'll let us patch the workflow after they've adopted it. So in theory we could potentially add SLSA support in the future. @sigurdm, any ideas? should we extend the reusable-workflow to install Flutter, when there is an SDK dependency on Flutter? I'm not keep on patching the community maintained flutter-action repository to have reusable-workflow, because we would be unable to trust such a workflow on pub.dev -- should ever want to do thing that requires trust -- like inspecting github APIs to check if branch protection is enabled, etc, stuff that SLSA does. |
I don't currently see other good ways to go around this. The only alternative would be to disable the resolution in the publish-step (as we cannot resolve against sdk dependencies without the sdk). |
@sigurdm, we could consider having a In practice, if you're publishing with automation, you really should put all of your unit tests ahead of the actual publishing step.. Or we should make the custom workflow install Flutter, I'm not sure if that'd be a huge issue. |
I think it's a bit non-intuitive to have the |
Perhaps having a separate |
Why doesn't setup-dart know how to setup flutter? |
We discussed this a bit on the weekly pub-meeting.
So that looks like having a dash-team script that can download and install Flutter is needed.
|
More importantly, it'll be hard to do SLSA in the future.
If we decided to do a Otherwise, perhaps it's find if we just extend |
+1. If there ever is a |
I'd like to add that The most widely used subosito/flutter-action doesn't support pulling the pub.dev token, so doing The result is that I have to use dart-lang/setup-dart, and then subosito/flutter-action to be able to use See this commit for an example of how I fixed it. Not a good experience, if you ask me. |
Keep in mind that the dart: APIs supported by the regular Dart SDK, and the Dart SDK vended into the Flutter SDK, are not the same. The Flutter version of the Dart SDK adds The main issue is that |
Can't the flow detect whether the package to be published is a Flutter package and if yes download Flutter and do everything with |
We landed a new option for opting out of all validations |
The first attempt failed because of dart-lang/setup-dart#68. This uses the --skip-validation option recommended in that issue. Apparently the workflow recommended by pub.dev actually doesn't work with Flutter plugins because it tries to do some client side validations that fail because the workflow does not setup Flutter...
The first attempt failed because of dart-lang/setup-dart#68. This uses the --skip-validation option recommended in that issue. Apparently the workflow recommended by pub.dev actually doesn't work with Flutter plugins because it tries to do some client side validations that fail because the workflow does not setup Flutter...
Can we add this option to the publish workflow? |
This is also an issue I am having right now. |
I have a working setup now: The crux is: - name: 📚 Git Checkout
uses: actions/checkout@v4
- name: 🐦 Setup Flutter
uses: subosito/flutter-action@v2
- name: 🪪 Get Id Token
uses: actions/github-script@v6
with:
script: |
let pub_token = await core.getIDToken('https://pub.dev')
core.exportVariable('PUB_TOKEN', pub_token)
- name: 📢 Authenticate
shell: ${{ inputs.shell }}
run: flutter pub pub token add https://pub.dev --env-var PUB_TOKEN Careful, what tripped me up for a while was that |
…ing#publishing-packages-using-github-actions due to lack of support for flutter; initial work on approach from dart-lang/setup-dart#68 (comment)
I am a new contributor who attempts to add a flutter_publish.yml workflow in my fork - #139 But when I run this workflow in my github actions it doesn't pass authentication.
|
Seems like we can have conditional steps: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/using-conditions-to-control-job-execution We could make an input "publish-with-flutter"
And if that is true we invoke some setup-flutter action instead of setup-dart... That would be slightly manual, but perhaps good enough |
Discussed with @jonasfj. We will update the publish workflow to also invoke a setup-flutter, and then publish using the dart executable from flutter/bin which sets up FLUTTER_ROOT. |
Our reasoning, is that we want to enable publishing flutter packages first. Is subosito/flutter-action still the prefered action for installing flutter? |
The action to publish packages doesn't work for Flutter packages due to the following error.
https://github.com/material-foundation/flutter-packages/actions/runs/4079639516/jobs/7031216899
Can this action be generalized or another one published for Flutter?
The text was updated successfully, but these errors were encountered: