File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : Publish to pub.dev
22
33on :
4- release :
5- types :
6- - published
4+ push :
5+ tags :
6+ - ' v[0-9]+.[0-9]+.[0-9]+* '
77 workflow_dispatch :
88
99permissions :
1010 contents : read
11- id-token : write
1211
1312jobs :
1413 publish :
15- runs-on : ubuntu-latest
16- timeout-minutes : 20
17- if : github.event_name == 'workflow_dispatch' || startsWith(github.event.release.tag_name, 'v')
18- steps :
19- - name : Checkout
20- uses : actions/checkout@v4
21-
22- - name : Setup Flutter
23- uses : subosito/flutter-action@v2
24- with :
25- channel : stable
26- cache : true
27-
28- - name : Verify release tag matches pubspec version
29- if : github.event_name == 'release'
30- run : |
31- version=$(grep '^version:' pubspec.yaml | awk '{print $2}')
32- if [ "v$version" != "${{ github.event.release.tag_name }}" ]; then
33- echo "Tag mismatch: pubspec version is v$version but release tag is ${{ github.event.release.tag_name }}"
34- exit 1
35- fi
36-
37- - name : Install dependencies
38- run : flutter pub get
39-
40- - name : Verify OIDC is available
41- run : |
42- if [ -z "${ACTIONS_ID_TOKEN_REQUEST_URL:-}" ]; then
43- echo "OIDC token endpoint is not available. Check workflow permissions."
44- exit 1
45- fi
46-
47- - name : Validate package
48- run : flutter pub publish --dry-run
49-
50- - name : Publish package
51- run : timeout 10m flutter pub publish -f
14+ permissions :
15+ id-token : write
16+ uses : dart-lang/setup-dart/.github/workflows/publish.yml@v1
You can’t perform that action at this time.
0 commit comments