-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (31 loc) · 1.14 KB
/
simple_workflow.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Manual Publish to pub.dev
on:
workflow_dispatch: # ✅ Allows manual trigger from GitHub UI
jobs:
publish:
name: Publish to pub.dev
runs-on: ubuntu-latest
permissions:
id-token: write # ✅ Required for authentication using OIDC
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Dart & Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "latest" # Specify the Flutter version if needed
- name: Install Dependencies
run: flutter pub get
- name: Authenticate & Publish
env:
PUB_CREDENTIALS: ${{ secrets.PUB_CREDENTIALS }} # 🔑 Store credentials in GitHub Secrets
run: |
echo "$PUB_CREDENTIALS" > credentials.json
flutter pub publish --force # ✅ Fixed command for Flutter packages
rm credentials.json # 🧹 Clean up credentials file
- name: Success Message
if: success()
run: echo "✅ Package published successfully!"
- name: Failure Message
if: failure()
run: echo "❌ Publishing failed. Check logs for details."