Skip to content

Commit 2e1c014

Browse files
authored
fix(ci): Incorrect publish workflow for Flutter (#66)
1 parent ba143e0 commit 2e1c014

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed
Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ env:
88
FLUTTER_VERSION: '3.x'
99

1010
jobs:
11+
# TODO https://github.com/Flagsmith/flagsmith-flutter-client/issues/57
1112
analyze:
1213
runs-on: ubuntu-latest
1314
name: Dart Analyze
@@ -20,9 +21,24 @@ jobs:
2021
- run: flutter pub get
2122
- run: flutter analyze
2223

23-
# TODO https://github.com/Flagsmith/flagsmith-flutter-client/issues/57
24-
2524
publish:
2625
permissions:
2726
id-token: write
28-
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v4
30+
31+
- name: Setup Flutter
32+
uses: subosito/flutter-action@v2
33+
34+
- name: Get pub.dev token
35+
uses: actions/github-script@v6
36+
with:
37+
script: |
38+
let pub_token = await core.getIDToken('https://pub.dev')
39+
core.exportVariable('PUB_TOKEN', pub_token)
40+
41+
- name: Publish
42+
run: |
43+
flutter pub pub token add https://pub.dev --env-var PUB_TOKEN
44+
flutter pub publish

.github/workflows/pull-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040

4141
# TODO https://github.com/Flagsmith/flagsmith-flutter-client/issues/57
4242

43-
publishing:
43+
publish-dry-run:
4444
runs-on: ubuntu-latest
4545
name: Dart Publish Package Test
4646
needs: tests

0 commit comments

Comments
 (0)