-
Notifications
You must be signed in to change notification settings - Fork 73
67 lines (57 loc) · 1.54 KB
/
flutter_pub_publish.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Dart Pub Publish Workflow
on:
workflow_call:
inputs:
flutter_channel:
required: false
type: string
default: "stable"
flutter_version:
required: false
type: string
default: ""
working_directory:
required: false
type: string
default: "."
runs_on:
required: false
type: string
default: "ubuntu-latest"
# Deprecated, use secrets.pub_credentials instead
pub_credentials:
required: false
type: string
timeout_minutes:
required: false
type: number
default: 5
secrets:
pub_credentials:
required: true
jobs:
publish:
defaults:
run:
working-directory: ${{inputs.working_directory}}
runs-on: ${{inputs.runs_on}}
timeout-minutes: ${{inputs.timeout_minutes}}
steps:
- name: 📚 Git Checkout
uses: actions/checkout@v4
- name: 🐦 Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{inputs.flutter_version}}
channel: ${{inputs.flutter_channel}}
cache: true
- name: 📦 Install Dependencies
run: flutter pub get
- name: 🔐 Setup Pub Credentials
run: |
mkdir -p $XDG_CONFIG_HOME/dart
echo '${{secrets.pub_credentials}}' > "$XDG_CONFIG_HOME/dart/pub-credentials.json"
- name: 🌵 Dry Run
run: flutter pub publish --dry-run
- name: 📢 Publish
run: flutter pub publish -f