-
Notifications
You must be signed in to change notification settings - Fork 147
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
Support automated publishing from CI #5388
Comments
Hi there, I would love this feature! The fact that Dart does not support easy automated deployment is surprising. The only thing I am wondering about is why pub.dev does not support From a quick look into the code, I would presume one could implement that with an |
This would be nice to have, I was trying to automate the deploy on our library https://github.com/la-haus/iterable-flutter/runs/6353878819?check_suite_focus=true using my personal credential.json but it throws an error:
Based on this it is not possible to automate the library deployment from the CI? it can only be done from the developer machine? |
You can deploy with your |
@Coronon I got a blocker, it says this: Pub needs your authorization to upload packages on your behalf.
In a web browser, go to https://accounts.google.com/o/oauth2/auth?access_type=offline&approval_prompt=force&response_type=code&client_id=xxxx-xxxxx.apps.googleusercontent.com&redirect_uri=http%3A%2F%2Flocalhost%3A37523&code_challenge=xxxx-xxxxth%2Fuserinfo.email
Then click "Allow access". But I haven't tried with |
I really dont want to use this thread for tech support, so this is my final reply here, see my profile for my email if you need more help. Check if the PS: Most issues seem to arise because people haven't figured out that the PPS: You will always have to use |
Thanks for that @Coronon I will try it |
@Coronon I cant find the json in: |
It seems you are talking about macOS while I am referring to linux ;) |
@Coronon I confirm that it works! thanks for helping me |
This is my workflow file - https://github.com/git-elliot/network_tools/blob/main/.github/workflows/publish.yml and script file to setup env vars - https://github.com/git-elliot/network_tools/blob/main/pub_login.sh. |
@git-elliot To reiterate again: I have a full working example. Your path to the credentials is wrong as Dart changed them a few versions ago. The new path is |
@Coronon My bad that I've referenced files from my main branch. I'm adding my files from dev branch now. I've tried with ($HOME/.config/dart/pub-credentials.json) this path only. |
@git-elliot You are missing the |
Yeah @Coronon. I can also see the same. But there is no idToken in my json file as I can see clearly. |
@git-elliot have you tried logging out and in again? Or delete your current credentials file and then log in again? |
@Coronon Seems like logging out and in was the only solution to that problem. Thanks a lot. It worked. |
Glad to hear that :) |
Closing - this is done: https://dart.dev/tools/pub/automated-publishing |
It's not obvious how to do it with an open source project where you'd like to enable auto publishing when a PR passes on a specific branch |
@cedvdb perhaps you can find inspiration in the dart-teams "firehose" scripts: https://github.com/dart-lang/ecosystem/tree/main/pkgs/firehose |
Unfortunately, It doesn't seem to work with Flutter packages... I have looked into the code and the |
@Tienisto Have a look at the following: https://github.com/Skycoder42/dart_test_tools/blob/main/.github/workflows/publish.yml#L87 There I basically copied the code from the dart action to add the token in the same way but for flutter |
This doesn't work with Flutter packages. We need better support for flutter packages and needs support CI to publish them. |
legit answer 👍 👍 👍 |
@sigurdm: I'm a bit unsure/out-of-context here: what is the part that we need to implement/provide? |
The current github action (dart-lang/setup-dart/.github/workflows/publish.yml@v1) for automated publication does not install flutter, but only dart, making it hard to do automated publishing. |
TODO: design out this should work, probably we can use OIDC from Github Actions, and similar features from Gitlab.
The text was updated successfully, but these errors were encountered: