-
Notifications
You must be signed in to change notification settings - Fork 73
59 lines (49 loc) · 1.36 KB
/
dart_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
name: Dart Pub Publish Workflow
on:
workflow_call:
inputs:
dart_sdk:
required: false
type: string
default: "stable"
working_directory:
required: false
type: string
default: "."
runs_on:
required: false
type: string
default: "ubuntu-latest"
timeout_minutes:
required: false
type: number
default: 5
# Deprecated, will be used if passed in but using the "Setup Dart" action is recommended
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 Dart
uses: dart-lang/setup-dart@v1
with:
sdk: ${{inputs.dart_sdk}}
- name: 📦 Install Dependencies
run: dart pub get
- name: 🔐 Setup Pub Credentials
if: ${{ secrets.pub_credentials != '' }}
run: |
mkdir -p $XDG_CONFIG_HOME/dart
echo '${{secrets.pub_credentials}}' > "$XDG_CONFIG_HOME/dart/pub-credentials.json"
- name: 🌵 Dry Run
run: dart pub publish --dry-run
- name: 📢 Publish
run: dart pub publish -f