-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Cannot publish in such env. #7
Comments
I've found a solution, but it's a little bit waste computational resources: add a line to setup Dart environment using the official Dart setup action, and it can publish normally. Just like the following code: name: publish
on:
push:
tags: ["v[0-9]+.[0-9]+.[0-9]+*"]
jobs:
# https://dart.dev/tools/pub/automated-publishing
publish:
runs-on: ubuntu-latest
permissions: {id-token: write}
steps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
- uses: flutter-actions/setup-flutter@v3
- run: flutter pub get
- run: flutter pub publish --dry-run
- run: flutter pub publish --force But this workflow will also setup a Dart environment, which is repeated, as the Flutter SDK includes a Dart SDK. So it's still recommended to fix something about OIDC in this action repo. |
It's not a problem about version specification. I've tried with specified versions, even older versions, but such problem always appear. |
This comment was marked as outdated.
This comment was marked as outdated.
I think I found the solution to this, since the official Not able to guarantee when this will be done, but I will try to add it asap. |
Thanks, I can understand where the problem is according to the code you mentioned before. If I'm available, I will also try to fix this problem and make a PR. |
I've put sth together for this particular issue. Maybe you can give it a try https://github.com/flutter-actions/setup-pubdev-credentials. You can temporarily use the |
Wow, you are so fast. Sorry that I'm really busy these days. I'll try the new action asap once my package's new version is prepared. |
This new action works well and I have already published my new package using such action successfully. Thanks a lot. |
Glad to hear that 😉 |
I've wrote a script based on such Flutter SDK env setup in order to publish a Flutter package onto pub.dev. Publishing from GitHub Actions requires OIDC, but once using this action, even if
permissions: {id-token: write}
is enabled, it cannot authentic with OIDC and the publishing process can never finish.Here's my
publish.yaml
file inside.github/workflows
folder:The text was updated successfully, but these errors were encountered: