Skip to content

Commit 52b8389

Browse files
committed
ci: add oidc
1 parent 9660787 commit 52b8389

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

.github/workflows/cd.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
name: Publish to Pub.dev & Github
22
on:
3+
workflow_dispatch:
34
pull_request:
45
types:
56
- closed
67
branches:
78
- main
89
- rel/**
910

11+
permissions:
12+
id-token: write # Required for authentication using OIDC
13+
contents: write
14+
1015
jobs:
1116
publish:
1217
if: |
13-
github.event.pull_request.merged == true &&
14-
contains(github.event.pull_request.title, 'chore: Release')
18+
github.event_name == 'workflow_dispatch' ||
19+
(github.event.pull_request.merged == true &&
20+
contains(github.event.pull_request.title, 'chore: Release'))
1521
runs-on: ubuntu-latest
1622
outputs:
1723
version: ${{ steps.version.outputs.version }}
@@ -22,6 +28,10 @@ jobs:
2228
- name: Set up Flutter
2329
uses: ./.github/actions/setup-flutter
2430

31+
# This step is what enables Dart's OIDC "trusted publishing" wiring.
32+
# Even though you publish with flutter, OIDC creds are handled via Dart tooling.
33+
- uses: dart-lang/setup-dart@v1
34+
2535
- name: Get version from pubspec.yaml
2636
id: version
2737
run: |

0 commit comments

Comments
 (0)