File tree Expand file tree Collapse file tree 2 files changed +20
-16
lines changed
Expand file tree Collapse file tree 2 files changed +20
-16
lines changed Original file line number Diff line number Diff line change 1- name : Publish to Pub.dev & Github
1+ # For Flutter publish, a tag must be created first so we create a Github Release
2+ # Then this should trigger the publish to Pub.dev workflow
3+ name : Publish to Github
24on :
35 workflow_dispatch :
46 pull_request :
810 - main
911 - rel/**
1012
11- permissions :
12- id-token : write # Required for authentication using OIDC
13- contents : write
14-
1513jobs :
1614 publish :
1715 if : |
@@ -25,24 +23,13 @@ jobs:
2523 - name : Checkout
2624 uses : actions/checkout@v5
2725
28- - name : Set up Flutter
29- uses : ./.github/actions/setup-flutter
30-
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-
3526 - name : Get version from pubspec.yaml
3627 id : version
3728 run : |
3829 VERSION=$(grep "^version:" pubspec.yaml | sed 's/version: //' | tr -d ' ')
3930 echo "version=$VERSION" >> $GITHUB_OUTPUT
4031 echo "Version: $VERSION"
4132
42- - name : Publish to Pub.dev
43- run : |
44- flutter pub publish --force
45-
4633 create-release :
4734 needs : publish
4835 uses : OneSignal/sdk-actions/.github/workflows/github-release.yml@main
Original file line number Diff line number Diff line change 1+ # OIDC published for pub.dev
2+ # Reference: https://dart.dev/tools/pub/automated-publishing
3+ name : Publish to pub.dev
4+
5+ on :
6+ push :
7+ tags :
8+ # must align with the tag-pattern configured on pub.dev, often just replace
9+ # {{version}} with [0-9]+.[0-9]+.[0-9]+
10+ - " [0-9]+.[0-9]+.[0-9]+" # tag-pattern on pub.dev: '{{version}}'
11+
12+ # Publish using the reusable workflow from dart-lang.
13+ jobs :
14+ publish :
15+ permissions :
16+ id-token : write # Required for authentication using OIDC
17+ uses : dart-lang/setup-dart/.github/workflows/publish.yml@v1
You can’t perform that action at this time.
0 commit comments