|
39 | 39 | runs-on: ubuntu-latest |
40 | 40 | permissions: |
41 | 41 | contents: write # push version bump commit |
42 | | - id-token: write # pub.dev OIDC trusted publisher |
43 | 42 | outputs: |
44 | 43 | tag: ${{ steps.meta.outputs.tag }} |
45 | 44 | version: ${{ steps.meta.outputs.version }} |
@@ -103,5 +102,39 @@ jobs: |
103 | 102 | body_path: /tmp/release_notes.md |
104 | 103 | prerelease: ${{ steps.meta.outputs.prerelease }} |
105 | 104 |
|
| 105 | + publish: |
| 106 | + name: Publish to pub.dev |
| 107 | + needs: prepare |
| 108 | + runs-on: ubuntu-latest |
| 109 | + permissions: |
| 110 | + id-token: write # pub.dev OIDC trusted publisher |
| 111 | + steps: |
| 112 | + # `main` at this point already has the version bump `prepare` pushed — |
| 113 | + # the pushed tag itself still points at the pre-bump commit, so we |
| 114 | + # can't just let this default to `github.ref`. |
| 115 | + - uses: actions/checkout@v7 |
| 116 | + with: |
| 117 | + ref: main |
| 118 | + submodules: recursive |
| 119 | + |
| 120 | + # dart-lang/setup-dart requests and configures the OIDC token pub.dev's |
| 121 | + # trusted-publisher flow needs — this is the piece that was missing |
| 122 | + # before; subosito/flutter-action (below) never provisions it. |
| 123 | + - uses: dart-lang/setup-dart@v1 |
| 124 | + |
| 125 | + # Flutter SDK is required to resolve `flutter: sdk: flutter` in |
| 126 | + # pubspec.yaml. Its bundled `dart` binary shadows the one from |
| 127 | + # setup-dart on PATH, but both read the same pub credentials that |
| 128 | + # setup-dart just wrote. |
| 129 | + - uses: subosito/flutter-action@v2 |
| 130 | + with: |
| 131 | + channel: stable |
| 132 | + |
| 133 | + - name: Install dependencies |
| 134 | + run: dart pub get |
| 135 | + |
| 136 | + - name: Publish - dry run |
| 137 | + run: dart pub publish --dry-run |
| 138 | + |
106 | 139 | - name: Publish to pub.dev |
107 | 140 | run: dart pub publish --force |
0 commit comments